Saving tests
Rust Build / Test Suite (pull_request) Failing after 34s
Rust Build / Rustfmt (pull_request) Successful in 41s

This commit is contained in:
2026-06-20 23:00:32 -04:00
parent 78dfe082e0
commit c0a9210cf1
+6 -6
View File
@@ -14,9 +14,12 @@ mod db_mgr {
}
pub async fn generate_db_name() -> String {
/*
let db_name =
get_database_name().await.unwrap() + &"_" + &uuid::Uuid::new_v4().to_string()[..LIMIT];
db_name
*/
format!("{}", get_database_name().await.unwrap())
}
pub async fn connect_to_db(db_name: &str) -> Result<sqlx::PgPool, sqlx::Error> {
@@ -29,11 +32,9 @@ mod db_mgr {
pub async fn create_database(
template_pool: &sqlx::PgPool,
db_name: &str,
_db_name: &str,
) -> Result<(), sqlx::Error> {
// let query = format!("CREATE DATABASE {}", db_name);
match sqlx::query(r#"CREATE DATABASE $1"#)
.bind(db_name)
match sqlx::query(r#"CREATE DATABASE textsender_db"#)
.execute(template_pool)
.await
{
@@ -70,8 +71,7 @@ mod db_mgr {
template_pool: &sqlx::PgPool,
_db_name: &str,
) -> Result<(), sqlx::Error> {
sqlx::query(r#"DROP DATABASE IF EXISTS $1 WITH (FORCE)"#)
.bind(_db_name)
sqlx::query(r#"DROP DATABASE IF EXISTS textsender_db WITH (FORCE)"#)
.execute(template_pool)
.await?;
Ok(())