Browse Source

Starting with SQLx (and some Tokio)

master
Julio Biason 4 years ago
parent
commit
010afea19b
  1. 1172
      sqlxtest/Cargo.lock
  2. 9
      sqlxtest/Cargo.toml
  3. 9
      sqlxtest/src/main.rs

1172
sqlxtest/Cargo.lock generated

File diff suppressed because it is too large Load Diff

9
sqlxtest/Cargo.toml

@ -0,0 +1,9 @@
[package]
name = "sqlxtest"
version = "0.1.0"
authors = ["Julio Biason <julio.biason@pm.me>"]
edition = "2018"
[dependencies]
sqlx = { version = "0.5", default-features = false, features = [ "sqlite", "chrono", "macros", "migrate", "runtime-tokio-rustls"] }
tokio = { version = "1.6", features = [ "rt", "macros" ] }

9
sqlxtest/src/main.rs

@ -0,0 +1,9 @@
use sqlx::pool::Pool;
use sqlx::sqlite::Sqlite;
#[tokio::main]
async fn main() -> Result<(), sqlx::Error> {
let pool = Pool::<Sqlite>::connect("sqlite::memory:").await?;
sqlx::migrate!("db/migrations").run(&pool).await?;
Ok(())
}
Loading…
Cancel
Save