Leave bulk-ref mode: recreate each index in one scan (yield between).
()
| 255 | |
| 256 | /** Leave bulk-ref mode: recreate each index in one scan (yield between). */ |
| 257 | async endBulkRefLoad(): Promise<void> { |
| 258 | const schemaPath = path.join(__dirname, 'schema.sql'); |
| 259 | const schema = fs.readFileSync(schemaPath, 'utf-8'); |
| 260 | for (const idx of DatabaseConnection.BULK_REF_INDEX_NAMES) { |
| 261 | const m = schema.match(new RegExp(`CREATE INDEX IF NOT EXISTS ${idx}\\b[^;]*;`)); |
| 262 | if (!m) throw new Error(`schema.sql: ref index ${idx} not found for bulk-load recreation`); |
| 263 | this.db.exec(m[0]); |
| 264 | await new Promise((resolve) => setImmediate(resolve)); |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * Names of the NON-UNIQUE edge indexes dropped for a bulk edge load. |
no test coverage detected