refactor(server): inject database options

This commit is contained in:
Dax Raad
2026-07-20 13:01:01 -04:00
parent 61b7caa0b5
commit f971aa0719
14 changed files with 93 additions and 52 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
import { rm } from "fs/promises"
import { Database } from "@opencode-ai/core/database/database"
import { InstallationDatabase } from "@/installation/database"
import { disposeAllInstances } from "./fixture"
export async function resetDatabase() {
await disposeAllInstances().catch(() => undefined)
const dbPath = Database.path()
const dbPath = InstallationDatabase.path()
await rm(dbPath, { force: true }).catch(() => undefined)
await rm(`${dbPath}-wal`, { force: true }).catch(() => undefined)
await rm(`${dbPath}-shm`, { force: true }).catch(() => undefined)