From aa38a85fc8517f8dac4459e7bedf97b15770152c Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Fri, 30 Jan 2026 11:33:39 +0100 Subject: [PATCH 1/2] fix: set temp store to be in-memory --- src/wasm/src/database/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wasm/src/database/mod.rs b/src/wasm/src/database/mod.rs index 1ed01d00..72cd8426 100644 --- a/src/wasm/src/database/mod.rs +++ b/src/wasm/src/database/mod.rs @@ -242,6 +242,10 @@ impl DatabaseState { // The WORK_DB_PATH is the "master" SQLite path. We have logic copying over bundled navigation data if needed in the DatabaseState::new function. let conn = Connection::open_with_flags(WORK_DB_PATH, flags)?; + + // Use memory for temp storage (avoids directory issues with the work folder) + conn.execute_batch("PRAGMA temp_store = MEMORY")?; + self.database = Some(conn); Ok(()) From f2109b688b01ed79a2ec479042e53b4cc930f1e5 Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Fri, 30 Jan 2026 11:48:11 +0100 Subject: [PATCH 2/2] docs: clarify tradeoff --- src/wasm/src/database/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wasm/src/database/mod.rs b/src/wasm/src/database/mod.rs index 72cd8426..07cbb1a3 100644 --- a/src/wasm/src/database/mod.rs +++ b/src/wasm/src/database/mod.rs @@ -243,7 +243,7 @@ impl DatabaseState { // The WORK_DB_PATH is the "master" SQLite path. We have logic copying over bundled navigation data if needed in the DatabaseState::new function. let conn = Connection::open_with_flags(WORK_DB_PATH, flags)?; - // Use memory for temp storage (avoids directory issues with the work folder) + // Use memory for temp storage (avoids directory issues with the work folder, with the tradeoff of higher memory usage for queries) conn.execute_batch("PRAGMA temp_store = MEMORY")?; self.database = Some(conn);