* Delete resolved references by their IDs
(fromNodeIds: string[])
| 5204 | * Delete resolved references by their IDs |
| 5205 | */ |
| 5206 | deleteResolvedReferences(fromNodeIds: string[]): void { |
| 5207 | if (fromNodeIds.length === 0) return; |
| 5208 | // Chunk under SQLite's parameter limit, matching every other IN-list in |
| 5209 | // this file. The internal resolution path uses deleteSpecificResolvedReferences |
| 5210 | // instead, but QueryBuilder is part of the public API, so a library consumer |
| 5211 | // passing more ids than SQLITE_MAX_VARIABLE_NUMBER (32766 on the bundled |
| 5212 | // node:sqlite) would otherwise hit "too many SQL variables". (#540, #1001) |
| 5213 | for (let i = 0; i < fromNodeIds.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 5214 | const chunk = fromNodeIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 5215 | const placeholders = chunk.map(() => '?').join(','); |
| 5216 | this.db.prepare(`DELETE FROM unresolved_refs WHERE from_node_id IN (${placeholders})`).run(...chunk); |
| 5217 | } |
| 5218 | } |
| 5219 | |
| 5220 | /** |
| 5221 | * Delete specific resolved references by (fromNodeId, referenceName, referenceKind) tuples. |
no test coverage detected