Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/opencode/src/storage/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })

Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/src/storage/json-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading