bump: sqlx (#26)
Reviewed-on: phoenix/textsender_api#26
This commit was merged in pull request #26.
This commit is contained in:
+13
-4
@@ -31,8 +31,13 @@ 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(sqlx::AssertSqlSafe(format!(
|
||||
r#"CREATE DATABASE {}"#,
|
||||
db_name
|
||||
)))
|
||||
.execute(template_pool)
|
||||
.await
|
||||
{
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
@@ -66,8 +71,12 @@ 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(sqlx::AssertSqlSafe(format!(
|
||||
r#"DROP DATABASE IF EXISTS {} WITH (FORCE)"#,
|
||||
db_name
|
||||
)))
|
||||
.execute(template_pool)
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user