From 3a27c7e38980fd7b8cfffa69b916dfb8e7f462fd Mon Sep 17 00:00:00 2001 From: C0ffeeCode Date: Wed, 1 May 2024 17:20:07 +0200 Subject: [PATCH] Fix (storage): Avoid bug creating file for in-mem sqlite --- src/storage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage.rs b/src/storage.rs index 123afb8..4a46653 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -8,7 +8,7 @@ pub async fn create_pool(db_url: String) -> AnyPool { sqlx::any::install_default_drivers(); // Create SQLite database file if it does not exist - if db_url.starts_with("sqlite:") { + if db_url.starts_with("sqlite:") && db_url != ("sqlite::memory:") { let path = db_url.replace("sqlite:", ""); if !Path::new(&path).exists() { warn!("Sqlite database does not exist, creating file {}", path);