fix: in-memory SQLite DB correctly shares memory between connections

fixes: https://todo.sr.ht/~gheartsfield/nostr-rs-relay/73#event-227131
This commit is contained in:
Greg Heartsfield 2023-02-21 08:14:19 -06:00
parent df411c24fb
commit 5f6ff4c2b7

View File

@ -932,7 +932,7 @@ pub fn build_pool(
} }
} }
let manager = if settings.database.in_memory { let manager = if settings.database.in_memory {
SqliteConnectionManager::memory() SqliteConnectionManager::file("file::memory:?cache=shared")
.with_flags(flags) .with_flags(flags)
.with_init(|c| c.execute_batch(STARTUP_SQL)) .with_init(|c| c.execute_batch(STARTUP_SQL))
} else { } else {