File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
crates/pg_schema_cache/src Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,21 @@ impl SchemaCache {
4444 fn pool_to_conn_str ( pool : & PgPool ) -> String {
4545 let conn = pool. connect_options ( ) ;
4646
47- format ! (
48- "postgres://{}:<redacted_pw>@{}:{}/{}" ,
49- conn. get_username( ) ,
50- conn. get_host( ) ,
51- conn. get_port( ) ,
52- conn. get_database( ) . unwrap_or( "default" )
53- )
47+ match conn. get_database ( ) {
48+ None => format ! (
49+ "postgres://{}:<redacted_pw>@{}:{}" ,
50+ conn. get_username( ) ,
51+ conn. get_host( ) ,
52+ conn. get_port( )
53+ ) ,
54+ Some ( db) => format ! (
55+ "postgres://{}:<redacted_pw>@{}:{}/{}" ,
56+ conn. get_username( ) ,
57+ conn. get_host( ) ,
58+ conn. get_port( ) ,
59+ db
60+ ) ,
61+ }
5462 }
5563
5664 pub fn has_already_cached_connection ( & self , pool : & PgPool ) -> bool {
You can’t perform that action at this time.
0 commit comments