Test fix
This commit is contained in:
+9
-4
@@ -31,8 +31,11 @@ mod db_mgr {
|
||||
template_pool: &sqlx::PgPool,
|
||||
db_name: &str,
|
||||
) -> Result<(), sqlx::Error> {
|
||||
let create_query = format!("CREATE DATABASE {}", db_name);
|
||||
match sqlx::query(&create_query).execute(template_pool).await {
|
||||
match sqlx::query(r#"CREATE DATABASE $1"#)
|
||||
.bind(db_name)
|
||||
.execute(template_pool)
|
||||
.await
|
||||
{
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
@@ -66,8 +69,10 @@ mod db_mgr {
|
||||
template_pool: &sqlx::PgPool,
|
||||
db_name: &str,
|
||||
) -> Result<(), sqlx::Error> {
|
||||
let drop_query = format!("DROP DATABASE IF EXISTS {} WITH (FORCE)", db_name);
|
||||
sqlx::query(&drop_query).execute(template_pool).await?;
|
||||
sqlx::query(r#"DROP DATABASE IF EXISTS $1 WITH (FORCE)"#)
|
||||
.bind(db_name)
|
||||
.execute(template_pool)
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user