Leave bulk-ref mode: recreate each index in one scan (yield between).
()
| 288 | |
| 289 | /** Leave bulk-ref mode: recreate each index in one scan (yield between). */ |
| 290 | async endBulkRefLoad(): Promise<void> { |
| 291 | const schemaPath = path.join(__dirname, 'schema.sql'); |
| 292 | const schema = fs.readFileSync(schemaPath, 'utf-8'); |
| 293 | for (const idx of DatabaseConnection.BULK_REF_INDEX_NAMES) { |
| 294 | const m = schema.match(new RegExp(`CREATE INDEX IF NOT EXISTS ${idx}\\b[^;]*;`)); |
| 295 | if (!m) throw new Error(`schema.sql: ref index ${idx} not found for bulk-load recreation`); |
| 296 | this.db.exec(m[0]); |
| 297 | await new Promise((resolve) => setImmediate(resolve)); |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * Names of the NON-UNIQUE edge indexes dropped for a bulk edge load. |
no test coverage detected