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

Method deleteNodesByFile

src/db/queries.ts:1033–1044  ·  view source on GitHub ↗

* Delete all nodes for a file

(filePath: string)

Source from the content-addressed store, hash-verified

1031 * Delete all nodes for a file
1032 */
1033 deleteNodesByFile(filePath: string): void {
1034 if (!this.stmts.deleteNodesByFile) {
1035 this.stmts.deleteNodesByFile = this.db.prepare('DELETE FROM nodes WHERE file_path = ?');
1036 }
1037 // Invalidate cache for nodes in this file
1038 for (const [id, node] of this.nodeCache) {
1039 if (node.filePath === filePath) {
1040 this.nodeCache.delete(id);
1041 }
1042 }
1043 this.stmts.deleteNodesByFile.run(filePath);
1044 }
1045
1046 // ===========================================================================
1047 // 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