Insert segments for a batch of names in one transaction (vocab heal path).
(names: string[])
| 678 | |
| 679 | /** Insert segments for a batch of names in one transaction (vocab heal path). */ |
| 680 | insertNameSegmentsBatch(names: string[]): void { |
| 681 | this.db.transaction(() => { |
| 682 | const rows: unknown[][] = []; |
| 683 | for (const name of names) this.collectNameSegmentRows(name, rows); |
| 684 | this.runBatched( |
| 685 | 'insertNameSegments', |
| 686 | 'INSERT OR IGNORE INTO name_segment_vocab (segment, name) VALUES ', |
| 687 | '(?,?)', |
| 688 | rows |
| 689 | ); |
| 690 | })(); |
| 691 | } |
| 692 | |
| 693 | /** |
| 694 | * Names whose segments cover at least `minWords` distinct PROMPT WORDS — |
no test coverage detected