(dbPath: string)
| 843 | * open, so a leftover sidecar is harmless. |
| 844 | */ |
| 845 | export function removeDatabaseFiles(dbPath: string): void { |
| 846 | // The main DB file first — its removal is the operation that must succeed (or |
| 847 | // report why it couldn't). force:true treats an already-missing file as done. |
| 848 | fs.rmSync(dbPath, { force: true }); |
| 849 | for (const suffix of WAL_SIDECAR_SUFFIXES) { |
| 850 | try { |
| 851 | fs.rmSync(dbPath + suffix, { force: true }); |
| 852 | } catch { |
| 853 | // A sidecar still held/locked is harmless — SQLite rebuilds it on open. |
| 854 | } |
| 855 | } |
| 856 | } |
no outgoing calls
no test coverage detected