@@ -6,6 +6,9 @@ use tokio_postgres::{Config as TokioPgConnectOptions, config::SslMode as TokioPg
6
6
use crate :: shared:: ValidationError ;
7
7
use crate :: { Config , SerializableSecretString } ;
8
8
9
+ /// The name identifying the application using this connection.
10
+ const ETL_APPLICATION_NAME : & str = "supabase_etl" ;
11
+
9
12
/// Postgres server options for ETL workloads.
10
13
///
11
14
/// Configures session-specific settings that are applied during connection
@@ -59,7 +62,7 @@ impl Default for PgConnectionOptions {
59
62
statement_timeout : 0 ,
60
63
lock_timeout : 30_000 , // 30 seconds in milliseconds
61
64
idle_in_transaction_session_timeout : 0 ,
62
- application_name : "etl" . to_string ( ) ,
65
+ application_name : ETL_APPLICATION_NAME . to_string ( ) ,
63
66
}
64
67
}
65
68
}
@@ -260,7 +263,7 @@ mod tests {
260
263
261
264
assert_eq ! (
262
265
options_string,
263
- "-c datestyle=ISO -c intervalstyle=postgres -c extra_float_digits=3 -c client_encoding=UTF8 -c timezone=UTC -c statement_timeout=0 -c lock_timeout=30000 -c idle_in_transaction_session_timeout=0 -c application_name=etl "
266
+ "-c datestyle=ISO -c intervalstyle=postgres -c extra_float_digits=3 -c client_encoding=UTF8 -c timezone=UTC -c statement_timeout=0 -c lock_timeout=30000 -c idle_in_transaction_session_timeout=0 -c application_name=supabase_etl "
264
267
) ;
265
268
}
266
269
@@ -281,6 +284,6 @@ mod tests {
281
284
"idle_in_transaction_session_timeout" . to_string( ) ,
282
285
"0" . to_string( )
283
286
) ) ) ;
284
- assert ! ( pairs. contains( & ( "application_name" . to_string( ) , "etl " . to_string( ) ) ) ) ;
287
+ assert ! ( pairs. contains( & ( "application_name" . to_string( ) , "supabase_etl " . to_string( ) ) ) ) ;
285
288
}
286
289
}
0 commit comments