Skip to content

Commit 865fc1f

Browse files
committed
Put everything under DEBUG_SQL
1 parent ba7b103 commit 865fc1f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

my-postgres-core/src/connection/connection_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub async fn start_connection_loop(
9090
inner.disconnect();
9191
}
9292

93-
if std::env::var("DEBUG").is_ok() {
93+
if std::env::var("DEBUG_SQL").is_ok() {
9494
println!("Postgres Connection loop is stopped");
9595
}
9696
}

my-postgres-core/src/connection/postgres_connect_inner.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl PostgresConnectionInner {
304304
) -> Result<Vec<Row>, MyPostgresError> {
305305
let mut start_connection = false;
306306

307-
let is_debug = std::env::var("DEBUG").is_ok();
307+
let is_debug = std::env::var("DEBUG_SQL").is_ok();
308308

309309
let mut sw = StopWatch::new();
310310
sw.start();
@@ -373,7 +373,7 @@ impl PostgresConnectionInner {
373373

374374
match connection_access {
375375
Some(connection_access) => {
376-
if std::env::var("DEBUG").is_ok() {
376+
if std::env::var("DEBUG_SQL").is_ok() {
377377
println!("SQL: {}", &sql.sql);
378378
}
379379

@@ -417,7 +417,7 @@ impl PostgresConnectionInner {
417417

418418
match connection_access {
419419
Some(connection_access) => {
420-
if std::env::var("DEBUG").is_ok() {
420+
if std::env::var("DEBUG_SQL").is_ok() {
421421
println!("SQL: {}", &sql.sql);
422422
}
423423

@@ -449,7 +449,7 @@ impl PostgresConnectionInner {
449449
sql_with_params: Vec<SqlData>,
450450
ctx: crate::RequestContext,
451451
) -> Result<(), MyPostgresError> {
452-
if std::env::var("DEBUG").is_ok() {
452+
if std::env::var("DEBUG_SQL").is_ok() {
453453
if let Some(first_value) = sql_with_params.get(0) {
454454
println!("SQL: {:?}", first_value.sql);
455455
}

my-postgres-core/src/sync_table_schema/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub async fn sync_schema(
1717
loop {
1818
println!("--------------------------------------------------");
1919
println!("Syncing table schema: {}", table_schema.table_name);
20-
if std::env::var("DEBUG").is_ok() {
20+
if std::env::var("DEBUG_SQL").is_ok() {
2121
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
2222
}
2323

0 commit comments

Comments
 (0)