Fix memory db closing

This commit is contained in:
august kline 2024-11-14 10:09:57 -05:00
parent d7798783ba
commit 0112e552fd
1 changed files with 2 additions and 2 deletions

View File

@ -57,12 +57,12 @@ impl BlogDb {
}
}
let memory = SqlitePoolOptions::new()
.min_connections(1)
.connect_with(
#[cfg(not(debug_assertions))]
SqliteConnectOptions::from_str(MEMORY_URL)?.journal_mode(SqliteJournalMode::Memory),
#[cfg(debug_assertions)]
SqliteConnectOptions::from_str(MEMORY_URL.as_ref())?
.journal_mode(SqliteJournalMode::Wal),
SqliteConnectOptions::from_str(MEMORY_URL)?.journal_mode(SqliteJournalMode::Wal),
)
.await?;
Self::run_main_migrations(&db).await?;