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

Method deleteNodesByFile

src/db/queries.ts:1035–1046  ·  view source on GitHub ↗

* Delete all nodes for a file

(filePath: string)

Source from the content-addressed store, hash-verified

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