ts_sqlx 0.1.3

Typescript SQLx compile-time checked queries without a DSL.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::future::Future;

use once_cell::sync::Lazy;
use tokio::runtime::{self, Runtime};

pub static RUNTIME: Lazy<Runtime> = Lazy::new(|| {
  runtime::Builder::new_current_thread()
    .enable_all()
    .build()
    .expect("failed to start Tokio runtime")
});

pub fn block_on<F>(f: F) -> F::Output
where
  F: Future,
{
  RUNTIME.block_on(f)
}