mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
postgres: Use username as default for database name
This commit is contained in:
parent
a2673f7880
commit
f3fe41ebdb
@ -112,7 +112,7 @@ pub struct PgConnection {
|
||||
async fn startup(stream: &mut PgStream, url: &Url) -> crate::Result<BackendKeyData> {
|
||||
// Defaults to postgres@.../postgres
|
||||
let username = url.username().unwrap_or(Cow::Borrowed("postgres"));
|
||||
let database = url.database().unwrap_or("postgres");
|
||||
let database = url.database().unwrap_or(&username);
|
||||
|
||||
// See this doc for more runtime parameters
|
||||
// https://www.postgresql.org/docs/12/runtime-config-client.html
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user