diff --git a/packages/opencode/src/storage/db.ts b/packages/opencode/src/storage/db.ts index f29aac18d16..763a6e84e5c 100644 --- a/packages/opencode/src/storage/db.ts +++ b/packages/opencode/src/storage/db.ts @@ -75,12 +75,12 @@ export namespace Database { const sqlite = new BunDatabase(path.join(Global.Path.data, "opencode.db"), { 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, schema }) diff --git a/packages/opencode/src/storage/json-migration.ts b/packages/opencode/src/storage/json-migration.ts index 828ce4799b4..5802ff6851f 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")