| 5389 | // rename took 18 s). |
| 5390 | const candidates = new Set<number>(); |
| 5391 | const idsWhere = (column: 'source' | 'target', nodeIds: string[]): void => { |
| 5392 | for (let i = 0; i < nodeIds.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 5393 | const chunk = nodeIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 5394 | const rows = this.db |
| 5395 | .prepare(`SELECT id FROM edges WHERE ${column} IN (${chunk.map(() => '?').join(',')})`) |
| 5396 | .all(...chunk) as Array<{ id: number }>; |
| 5397 | for (const r of rows) candidates.add(r.id); |
| 5398 | } |
| 5399 | }; |
| 5400 | // Edges into the affected module files. |
| 5401 | for (let i = 0; i < targetFiles.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 5402 | const chunk = targetFiles.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |