* Stream nodes of one language whose `decorators` JSON array contains * `decorator`. The LIKE on the JSON text is a cheap index-free pre-filter * (a decorator name can appear as a substring of another), so callers must * still exact-check `node.decorators.includes(decorator)`. Exists so the
(language: Language, decorator: string)
| 1080 | * default heap on a 2M-node graph (#1212). |
| 1081 | */ |
| 1082 | *iterateNodesByLanguageWithDecorator(language: Language, decorator: string): IterableIterator<Node> { |
| 1083 | // Fresh statement per call — an iterator holds an open cursor (see |
| 1084 | // iterateNodesByKind). |
| 1085 | const stmt = this.db.prepare( |
| 1086 | "SELECT * FROM nodes WHERE language = ? AND decorators LIKE '%' || ? || '%'" |
| 1087 | ); |
| 1088 | for (const row of stmt.iterate(language, `"${decorator}"`)) { |
| 1089 | yield rowToNode(row as NodeRow); |
| 1090 | } |
| 1091 | } |
| 1092 | |
| 1093 | /** |
| 1094 | * Distinct languages present in the files table. One indexed aggregate — |
no test coverage detected