* The `file` nodes for the given paths, in one query. * * A file's own node is what makes a file row navigable, and looking it up * with getNodesInFile means materialising every symbol in the file to * throw all but one away.
(filePaths: string[])
| 3365 | * throw all but one away. |
| 3366 | */ |
| 3367 | getFileNodes(filePaths: string[]): Node[] { |
| 3368 | if (filePaths.length === 0) return []; |
| 3369 | const rows = this.db |
| 3370 | .prepare( |
| 3371 | `SELECT * FROM nodes |
| 3372 | WHERE kind = 'file' |
| 3373 | AND file_path IN (SELECT value FROM json_each(?))` |
| 3374 | ) |
| 3375 | .all(JSON.stringify(filePaths)) as NodeRow[]; |
| 3376 | return rows.map(rowToNode); |
| 3377 | } |
| 3378 | |
| 3379 | /** |
| 3380 | * Roll the whole edge table up to module granularity in one pass. |