Insert segments for a batch of names in one transaction (vocab heal path).
(names: string[])
| 1160 | |
| 1161 | /** Insert segments for a batch of names in one transaction (vocab heal path). */ |
| 1162 | insertNameSegmentsBatch(names: string[]): void { |
| 1163 | this.db.transaction(() => { |
| 1164 | const rows: unknown[][] = []; |
| 1165 | for (const name of names) this.collectNameSegmentRows(name, rows); |
| 1166 | this.runBatched( |
| 1167 | 'insertNameSegments', |
| 1168 | 'INSERT OR IGNORE INTO name_segment_vocab (segment, name) VALUES ', |
| 1169 | '(?,?)', |
| 1170 | rows |
| 1171 | ); |
| 1172 | })(); |
| 1173 | } |
| 1174 | |
| 1175 | /** |
| 1176 | * Names whose segments cover at least `minWords` distinct PROMPT WORDS — |
no test coverage detected