Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move sqlx query logging to debug level #1128

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/db.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use sea_orm::{ConnectionTrait, Database, DbConn};
use log::LevelFilter;
use sea_orm::{ConnectOptions, ConnectionTrait, Database, DbConn};
use std::ops::{Deref, DerefMut};
use trillium::{async_trait, Conn, Handler};
use trillium_api::FromConn;
Expand All @@ -8,7 +9,9 @@ pub struct Db(DbConn);

impl Db {
pub async fn connect(url: &str) -> Self {
Database::connect(url).await.map(Self).unwrap()
let mut connect_options = ConnectOptions::new(url);
connect_options.sqlx_logging_level(LevelFilter::Debug);
Database::connect(connect_options).await.map(Self).unwrap()
}
}

Expand Down
Loading