* Get all nodes in several files at once — one chunked `IN` query rather than * one getNodesByFile per file (#1975).
(filePaths: readonly string[])
| 1370 | * one {@link getNodesByFile} per file (#1975). |
| 1371 | */ |
| 1372 | getNodesByFiles(filePaths: readonly string[]): Node[] { |
| 1373 | const unique = [...new Set(filePaths)]; |
| 1374 | const out: Node[] = []; |
| 1375 | for (let i = 0; i < unique.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 1376 | const chunk = unique.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 1377 | const placeholders = chunk.map(() => '?').join(','); |
| 1378 | const rows = this.db |
| 1379 | .prepare(`SELECT * FROM nodes WHERE file_path IN (${placeholders})`) |
| 1380 | .all(...chunk) as NodeRow[]; |
| 1381 | for (const row of rows) out.push(rowToNode(row)); |
| 1382 | } |
| 1383 | return out; |
| 1384 | } |
| 1385 | |
| 1386 | /** |
| 1387 | * Find the file that holds the densest concentration of the project's |
no test coverage detected