diff --git a/packages/opencode/src/storage/db.ts b/packages/opencode/src/storage/db.ts index beb8e3eb52c0..a12cdff30eb5 100644 --- a/packages/opencode/src/storage/db.ts +++ b/packages/opencode/src/storage/db.ts @@ -86,12 +86,12 @@ export namespace Database { const sqlite = new BunDatabase(Path, { create: true }) state.sqlite = sqlite - sqlite.run("PRAGMA journal_mode = WAL") + sqlite.run("PRAGMA journal_mode = DELETE") sqlite.run("PRAGMA synchronous = NORMAL") sqlite.run("PRAGMA busy_timeout = 5000") sqlite.run("PRAGMA cache_size = -64000") sqlite.run("PRAGMA foreign_keys = ON") - sqlite.run("PRAGMA wal_checkpoint(PASSIVE)") + sqlite.run("PRAGMA locking_mode = EXCLUSIVE") const db = drizzle({ client: sqlite }) diff --git a/packages/opencode/src/storage/json-migration.ts b/packages/opencode/src/storage/json-migration.ts index 828ce4799b4d..5802ff6851fe 100644 --- a/packages/opencode/src/storage/json-migration.ts +++ b/packages/opencode/src/storage/json-migration.ts @@ -46,7 +46,7 @@ export namespace JsonMigration { const db = drizzle({ client: sqlite }) // Optimize SQLite for bulk inserts - sqlite.exec("PRAGMA journal_mode = WAL") + sqlite.exec("PRAGMA journal_mode = DELETE") sqlite.exec("PRAGMA synchronous = OFF") sqlite.exec("PRAGMA cache_size = 10000") sqlite.exec("PRAGMA temp_store = MEMORY")