* 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[])
| 3693 | * throw all but one away. |
| 3694 | */ |
| 3695 | getFileNodes(filePaths: string[]): Node[] { |
| 3696 | if (filePaths.length === 0) return []; |
| 3697 | const rows = this.db |
| 3698 | .prepare( |
| 3699 | `SELECT * FROM nodes |
| 3700 | WHERE kind = 'file' |
| 3701 | AND file_path IN (SELECT value FROM json_each(?))` |
| 3702 | ) |
| 3703 | .all(JSON.stringify(filePaths)) as NodeRow[]; |
| 3704 | return rows.map(rowToNode); |
| 3705 | } |
| 3706 | |
| 3707 | /** |
| 3708 | * Roll the whole edge table up to module granularity in one pass. |