feat: conditional SQL statements logging for db-sqlx-postgres

This commit is contained in:
realaravinth
2022-05-30 15:48:54 +05:30
parent a9f8cc24a6
commit b30bc67bd4
3 changed files with 26 additions and 6 deletions

View File

@@ -68,7 +68,11 @@ async fn everyting_works() {
let url = env::var("POSTGRES_DATABASE_URL").unwrap();
let pool_options = PgPoolOptions::new().max_connections(2);
let connection_options = ConnectionOptions::Fresh(Fresh { pool_options, url });
let connection_options = ConnectionOptions::Fresh(Fresh {
pool_options,
url,
disable_logging: false,
});
let db = connection_options.connect().await.unwrap();
db.migrate().await.unwrap();