MCPcopy
hub / github.com/colbymchenry/codegraph / deleteNodesByFile

Method deleteNodesByFile

src/db/queries.ts:399–410  ·  view source on GitHub ↗

* Delete all nodes for a file

(filePath: string)

Source from the content-addressed store, hash-verified

397 * Delete all nodes for a file
398 */
399 deleteNodesByFile(filePath: string): void {
400 if (!this.stmts.deleteNodesByFile) {
401 this.stmts.deleteNodesByFile = this.db.prepare('DELETE FROM nodes WHERE file_path = ?');
402 }
403 // Invalidate cache for nodes in this file
404 for (const [id, node] of this.nodeCache) {
405 if (node.filePath === filePath) {
406 this.nodeCache.delete(id);
407 }
408 }
409 this.stmts.deleteNodesByFile.run(filePath);
410 }
411
412 /**
413 * Get a node by ID

Callers 1

deleteFileMethod · 0.95

Calls 2

prepareMethod · 0.65
runMethod · 0.65

Tested by

no test coverage detected