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

Method deleteNodesByFile

src/db/queries.ts:1101–1112  ·  view source on GitHub ↗

* Delete all nodes for a file

(filePath: string)

Source from the content-addressed store, hash-verified

1099 * Delete all nodes for a file
1100 */
1101 deleteNodesByFile(filePath: string): void {
1102 if (!this.stmts.deleteNodesByFile) {
1103 this.stmts.deleteNodesByFile = this.db.prepare('DELETE FROM nodes WHERE file_path = ?');
1104 }
1105 // Invalidate cache for nodes in this file
1106 for (const [id, node] of this.nodeCache) {
1107 if (node.filePath === filePath) {
1108 this.nodeCache.delete(id);
1109 }
1110 }
1111 this.stmts.deleteNodesByFile.run(filePath);
1112 }
1113
1114 // ===========================================================================
1115 // 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