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

Method deleteNodesByFile

src/db/queries.ts:681–692  ·  view source on GitHub ↗

* Delete all nodes for a file

(filePath: string)

Source from the content-addressed store, hash-verified

679 * Delete all nodes for a file
680 */
681 deleteNodesByFile(filePath: string): void {
682 if (!this.stmts.deleteNodesByFile) {
683 this.stmts.deleteNodesByFile = this.db.prepare('DELETE FROM nodes WHERE file_path = ?');
684 }
685 // Invalidate cache for nodes in this file
686 for (const [id, node] of this.nodeCache) {
687 if (node.filePath === filePath) {
688 this.nodeCache.delete(id);
689 }
690 }
691 this.stmts.deleteNodesByFile.run(filePath);
692 }
693
694 // ===========================================================================
695 // Name-segment vocabulary (prompt-hook graph-derived gate)

Callers 1

deleteFileMethod · 0.95

Calls 3

prepareMethod · 0.65
deleteMethod · 0.65
runMethod · 0.65

Tested by

no test coverage detected