Leave bulk-ref mode: recreate each index in one scan (yield between).
()
| 382 | |
| 383 | /** Leave bulk-ref mode: recreate each index in one scan (yield between). */ |
| 384 | async endBulkRefLoad(): Promise<void> { |
| 385 | const schemaPath = path.join(__dirname, 'schema.sql'); |
| 386 | const schema = fs.readFileSync(schemaPath, 'utf-8'); |
| 387 | for (const idx of DatabaseConnection.BULK_REF_INDEX_NAMES) { |
| 388 | const m = schema.match(new RegExp(`CREATE INDEX IF NOT EXISTS ${idx}\\b[^;]*;`)); |
| 389 | if (!m) throw new Error(`schema.sql: ref index ${idx} not found for bulk-load recreation`); |
| 390 | this.db.exec(m[0]); |
| 391 | await new Promise((resolve) => setImmediate(resolve)); |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | /** |
| 396 | * Names of the NON-UNIQUE edge indexes dropped for a bulk edge load. |
no test coverage detected