Janky fix for sqlite tests

This commit is contained in:
Lennart
2025-01-15 16:46:16 +01:00
parent c01f542e04
commit 618ed3b327
2 changed files with 11 additions and 4 deletions

View File

@@ -43,8 +43,12 @@ pub async fn create_db_pool(db_url: &str, migrate: bool) -> Result<Pool<Sqlite>,
Ok(db)
}
pub async fn create_test_store() -> Result<SqliteStore, sqlx::Error> {
pub async fn create_test_db() -> Result<SqlitePool, sqlx::Error> {
let db = SqlitePool::connect("sqlite::memory:").await?;
sqlx::migrate!("./migrations").run(&db).await?;
Ok(SqliteStore::new(db))
Ok(db)
}
pub async fn create_test_store() -> Result<SqliteStore, sqlx::Error> {
Ok(SqliteStore::new(create_test_db().await?))
}