From 2d1710251c450d66e96c505f0b5659a202b2065b Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 13 Apr 2023 08:15:55 +0200 Subject: [PATCH] demote sqlx log to debug --- src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a9327f8..2067b44 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,7 @@ +use std::str::FromStr; + use rot::rest; -use sqlx::SqlitePool; +use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, ConnectOptions}; #[macro_use] extern crate rocket; @@ -9,7 +11,12 @@ async fn rocket() -> _ { env_logger::init(); //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) }