* Delete resolved references by their IDs
(fromNodeIds: string[])
| 2212 | * Delete resolved references by their IDs |
| 2213 | */ |
| 2214 | deleteResolvedReferences(fromNodeIds: string[]): void { |
| 2215 | if (fromNodeIds.length === 0) return; |
| 2216 | // Chunk under SQLite's parameter limit, matching every other IN-list in |
| 2217 | // this file. The internal resolution path uses deleteSpecificResolvedReferences |
| 2218 | // instead, but QueryBuilder is part of the public API, so a library consumer |
| 2219 | // passing more ids than SQLITE_MAX_VARIABLE_NUMBER (32766 on the bundled |
| 2220 | // node:sqlite) would otherwise hit "too many SQL variables". (#540, #1001) |
| 2221 | for (let i = 0; i < fromNodeIds.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 2222 | const chunk = fromNodeIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 2223 | const placeholders = chunk.map(() => '?').join(','); |
| 2224 | this.db.prepare(`DELETE FROM unresolved_refs WHERE from_node_id IN (${placeholders})`).run(...chunk); |
| 2225 | } |
| 2226 | } |
| 2227 | |
| 2228 | /** |
| 2229 | * Delete specific resolved references by (fromNodeId, referenceName, referenceKind) tuples. |
no test coverage detected