Skip to content

Commit 582d217

Browse files
committed
update sqlite pragmas for iSH
1 parent eff68f3 commit 582d217

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/memory/db.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ impl BrainDb {
6868
let conn = Connection::open(&db_path)
6969
.map_err(|e| DbError(format!("open {}: {e}", db_path.display())))?;
7070

71-
// iSH-optimised PRAGMAs:
72-
// WAL + NORMAL sync: durable and 2× faster writes on constrained flash.
73-
// mmap 8 MiB: let OS page-cache serve hot reads without extra copies.
71+
// iSH-compatible PRAGMAs:
72+
// TRUNCATE is safer on iSH's emulated filesystem.
73+
// Disable mmap entirely to avoid uncatchable I/O errors and memory pressure.
7474
// temp_store MEMORY: temp tables never hit slow iSH storage.
7575
conn.execute_batch(
76-
"PRAGMA journal_mode = WAL;
76+
"PRAGMA journal_mode = TRUNCATE;
7777
PRAGMA synchronous = NORMAL;
78-
PRAGMA mmap_size = 8388608;
78+
PRAGMA mmap_size = 0;
7979
PRAGMA temp_store = MEMORY;",
8080
)?;
8181

0 commit comments

Comments
 (0)