(dbPath: string)
| 315 | * open, so a leftover sidecar is harmless. |
| 316 | */ |
| 317 | export function removeDatabaseFiles(dbPath: string): void { |
| 318 | // The main DB file first — its removal is the operation that must succeed (or |
| 319 | // report why it couldn't). force:true treats an already-missing file as done. |
| 320 | fs.rmSync(dbPath, { force: true }); |
| 321 | for (const suffix of WAL_SIDECAR_SUFFIXES) { |
| 322 | try { |
| 323 | fs.rmSync(dbPath + suffix, { force: true }); |
| 324 | } catch { |
| 325 | // A sidecar still held/locked is harmless — SQLite rebuilds it on open. |
| 326 | } |
| 327 | } |
| 328 | } |
no outgoing calls
no test coverage detected