Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ff963e9

Browse filesBrowse files
committed
fix!: define bootstrap superuser as postgres
1 parent 8c2e907 commit ff963e9
Copy full SHA for ff963e9

File tree

Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed

‎postgresql_embedded/src/postgresql.rs

Copy file name to clipboardExpand all lines: postgresql_embedded/src/postgresql.rs
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,16 +365,13 @@ impl PostgreSQL {
365365
self.settings.host,
366366
self.settings.port
367367
);
368-
let psql = PsqlBuilder::new()
368+
let psql = PsqlBuilder::from(&self.settings)
369369
.program_dir(self.settings.binary_dir())
370370
.command(format!(
371371
"DROP DATABASE IF EXISTS \"{}\"",
372372
database_name.as_ref()
373373
))
374-
.host(&self.settings.host)
375-
.port(self.settings.port)
376-
.username(&self.settings.username)
377-
.pg_password(&self.settings.password)
374+
.username(BOOTSTRAP_SUPERUSER)
378375
.no_psqlrc();
379376

380377
match self.execute_command(psql).await {

‎postgresql_embedded/tests/postgresql.rs

Copy file name to clipboardExpand all lines: postgresql_embedded/tests/postgresql.rs
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,8 @@ async fn test_username_setting() -> Result<()> {
159159
postgresql.create_database(database_name).await?;
160160
let database_exists = postgresql.database_exists(database_name).await?;
161161
assert!(database_exists);
162+
postgresql.drop_database(database_name).await?;
163+
let database_exists = postgresql.database_exists(database_name).await?;
164+
assert!(!database_exists);
162165
Ok(())
163166
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.