(dbPath: string)
| 820 | * open, so a leftover sidecar is harmless. |
| 821 | */ |
| 822 | export function removeDatabaseFiles(dbPath: string): void { |
| 823 | // The main DB file first — its removal is the operation that must succeed (or |
| 824 | // report why it couldn't). force:true treats an already-missing file as done. |
| 825 | fs.rmSync(dbPath, { force: true }); |
| 826 | for (const suffix of WAL_SIDECAR_SUFFIXES) { |
| 827 | try { |
| 828 | fs.rmSync(dbPath + suffix, { force: true }); |
| 829 | } catch { |
| 830 | // A sidecar still held/locked is harmless — SQLite rebuilds it on open. |
| 831 | } |
| 832 | } |
| 833 | } |
no outgoing calls
no test coverage detected