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

Method deleteNodesByFile

src/db/queries.ts:637–648  ·  view source on GitHub ↗

* Delete all nodes for a file

(filePath: string)

Source from the content-addressed store, hash-verified

635 * Delete all nodes for a file
636 */
637 deleteNodesByFile(filePath: string): void {
638 if (!this.stmts.deleteNodesByFile) {
639 this.stmts.deleteNodesByFile = this.db.prepare('DELETE FROM nodes WHERE file_path = ?');
640 }
641 // Invalidate cache for nodes in this file
642 for (const [id, node] of this.nodeCache) {
643 if (node.filePath === filePath) {
644 this.nodeCache.delete(id);
645 }
646 }
647 this.stmts.deleteNodesByFile.run(filePath);
648 }
649
650 // ===========================================================================
651 // Name-segment vocabulary (prompt-hook graph-derived gate)

Callers 1

deleteFileMethod · 0.95

Calls 2

prepareMethod · 0.65
runMethod · 0.65

Tested by

no test coverage detected