* Delete all nodes for a file
(filePath: string)
| 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 |
no test coverage detected