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() let memory = SqlitePoolOptions::new()
.min_connections(1)
.connect_with( .connect_with(
#[cfg(not(debug_assertions))] #[cfg(not(debug_assertions))]
SqliteConnectOptions::from_str(MEMORY_URL)?.journal_mode(SqliteJournalMode::Memory), SqliteConnectOptions::from_str(MEMORY_URL)?.journal_mode(SqliteJournalMode::Memory),
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
SqliteConnectOptions::from_str(MEMORY_URL.as_ref())? SqliteConnectOptions::from_str(MEMORY_URL)?.journal_mode(SqliteJournalMode::Wal),
.journal_mode(SqliteJournalMode::Wal),
) )
.await?; .await?;
Self::run_main_migrations(&db).await?; Self::run_main_migrations(&db).await?;