* Delete resolved references by their IDs
(fromNodeIds: string[])
| 4765 | * Delete resolved references by their IDs |
| 4766 | */ |
| 4767 | deleteResolvedReferences(fromNodeIds: string[]): void { |
| 4768 | if (fromNodeIds.length === 0) return; |
| 4769 | // Chunk under SQLite's parameter limit, matching every other IN-list in |
| 4770 | // this file. The internal resolution path uses deleteSpecificResolvedReferences |
| 4771 | // instead, but QueryBuilder is part of the public API, so a library consumer |
| 4772 | // passing more ids than SQLITE_MAX_VARIABLE_NUMBER (32766 on the bundled |
| 4773 | // node:sqlite) would otherwise hit "too many SQL variables". (#540, #1001) |
| 4774 | for (let i = 0; i < fromNodeIds.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 4775 | const chunk = fromNodeIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 4776 | const placeholders = chunk.map(() => '?').join(','); |
| 4777 | this.db.prepare(`DELETE FROM unresolved_refs WHERE from_node_id IN (${placeholders})`).run(...chunk); |
| 4778 | } |
| 4779 | } |
| 4780 | |
| 4781 | /** |
| 4782 | * Delete specific resolved references by (fromNodeId, referenceName, referenceKind) tuples. |
no test coverage detected