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