2026-02-27 20:36:39 +00:00
|
|
|
import { rm } from "fs/promises"
|
2026-07-20 17:01:01 +00:00
|
|
|
import { InstallationDatabase } from "@/installation/database"
|
2026-05-02 14:56:15 +00:00
|
|
|
import { disposeAllInstances } from "./fixture"
|
2026-02-27 20:36:39 +00:00
|
|
|
|
|
|
|
|
export async function resetDatabase() {
|
2026-05-02 14:56:15 +00:00
|
|
|
await disposeAllInstances().catch(() => undefined)
|
2026-07-20 17:01:01 +00:00
|
|
|
const dbPath = InstallationDatabase.path()
|
2026-05-14 22:39:10 +00:00
|
|
|
await rm(dbPath, { force: true }).catch(() => undefined)
|
|
|
|
|
await rm(`${dbPath}-wal`, { force: true }).catch(() => undefined)
|
|
|
|
|
await rm(`${dbPath}-shm`, { force: true }).catch(() => undefined)
|
2026-02-27 20:36:39 +00:00
|
|
|
}
|