Fix memory db closing
This commit is contained in:
parent
d7798783ba
commit
0112e552fd
|
@ -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?;
|
||||||
|
|
Loading…
Reference in New Issue