* Leave bulk-parse-load mode: recreate everything the window dropped, one * table scan per index, with a yield between statements (same * liveness-watchdog rationale as endBulkEdgeLoad — at kernel scale each * build is a long synchronous scan). The edge indexes are rebuilt here too, * so
()
| 243 | * beginBulkEdgeLoad simply re-drops them (DROP IF EXISTS — idempotent). |
| 244 | */ |
| 245 | async endBulkParseLoad(): Promise<void> { |
| 246 | const schemaPath = path.join(__dirname, 'schema.sql'); |
| 247 | const schema = fs.readFileSync(schemaPath, 'utf-8'); |
| 248 | for (const idx of DatabaseConnection.BULK_PARSE_INDEX_NAMES) { |
| 249 | const m = schema.match(new RegExp(`CREATE INDEX IF NOT EXISTS ${idx}\\b[^;]*;`)); |
| 250 | if (!m) throw new Error(`schema.sql: parse index ${idx} not found for bulk-load recreation`); |
| 251 | this.db.exec(m[0]); |
| 252 | await new Promise((resolve) => setImmediate(resolve)); |
| 253 | } |
| 254 | await this.endBulkEdgeLoad(); |
| 255 | } |
| 256 | |
| 257 | /** |
| 258 | * unresolved_refs secondary indexes NOT read by the batched resolution |
no test coverage detected