demote sqlx log to debug

This commit is contained in:
philipp 2023-04-13 08:15:55 +02:00
parent 659d2091e5
commit 2d1710251c

View File

@ -1,5 +1,7 @@
use std::str::FromStr;
use rot::rest; use rot::rest;
use sqlx::SqlitePool; use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, ConnectOptions};
#[macro_use] #[macro_use]
extern crate rocket; extern crate rocket;
@ -9,7 +11,12 @@ async fn rocket() -> _ {
env_logger::init(); env_logger::init();
//let pool = SqlitePool::connect(":memory:").await.unwrap(); //let pool = SqlitePool::connect(":memory:").await.unwrap();
let pool = SqlitePool::connect("db.sqlite").await.unwrap(); //TODO: fixme let mut connection_options = SqliteConnectOptions::from_str("sqlite://db.sqlite").unwrap();
connection_options.log_statements(log::LevelFilter::Debug);
let pool = PoolOptions::new()
.connect_with(connection_options)
.await
.unwrap();
rest::start(pool) rest::start(pool)
} }