Skip to content

Commit

Permalink
sqlx log level
Browse files Browse the repository at this point in the history
  • Loading branch information
RequescoS committed Jan 3, 2024
1 parent 4a4fd7f commit 806339c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions postgre-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use sqlx::{
postgres::{PgConnectOptions, PgPoolOptions},
PgPool, Postgres, QueryBuilder, Row, Transaction,
ConnectOptions, PgPool, Postgres, QueryBuilder, Row, Transaction,
};
use std::collections::HashMap;
use tracing::log::LevelFilter;

pub mod asset_filter_client;
pub mod asset_index_client;
Expand All @@ -16,7 +17,8 @@ pub struct PgClient {

impl PgClient {
pub async fn new(url: &str, min_connections: u32, max_connections: u32) -> Self {
let options: PgConnectOptions = url.parse().unwrap();
let mut options: PgConnectOptions = url.parse().unwrap();
options.log_statements(LevelFilter::Warn);

let pool = PgPoolOptions::new()
.min_connections(min_connections)
Expand Down

0 comments on commit 806339c

Please sign in to comment.