MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / removeDatabaseFiles

Function removeDatabaseFiles

src/db/index.ts:743–754  ·  view source on GitHub ↗
(dbPath: string)

Source from the content-addressed store, hash-verified

741 * open, so a leftover sidecar is harmless.
742 */
743export function removeDatabaseFiles(dbPath: string): void {
744 // The main DB file first — its removal is the operation that must succeed (or
745 // report why it couldn't). force:true treats an already-missing file as done.
746 fs.rmSync(dbPath, { force: true });
747 for (const suffix of WAL_SIDECAR_SUFFIXES) {
748 try {
749 fs.rmSync(dbPath + suffix, { force: true });
750 } catch {
751 // A sidecar still held/locked is harmless — SQLite rebuilds it on open.
752 }
753 }
754}

Callers 2

recreateMethod · 0.90
foundation.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected