(dbPath: string)
| 1043 | * open, so a leftover sidecar is harmless. |
| 1044 | */ |
| 1045 | export function removeDatabaseFiles(dbPath: string): void { |
| 1046 | // The main DB file first — its removal is the operation that must succeed (or |
| 1047 | // report why it couldn't). force:true treats an already-missing file as done. |
| 1048 | fs.rmSync(dbPath, { force: true }); |
| 1049 | for (const suffix of WAL_SIDECAR_SUFFIXES) { |
| 1050 | try { |
| 1051 | fs.rmSync(dbPath + suffix, { force: true }); |
| 1052 | } catch { |
| 1053 | // A sidecar still held/locked is harmless — SQLite rebuilds it on open. |
| 1054 | } |
| 1055 | } |
| 1056 | } |
no outgoing calls
no test coverage detected