MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / endBulkEdgeLoad

Method endBulkEdgeLoad

src/db/index.ts:344–353  ·  view source on GitHub ↗

* Leave bulk-edge-load mode: recreate the dropped indexes in one pass each * over the (now fully loaded) edges table — far cheaper than maintaining * them per-insert. DDL is extracted from schema.sql so it cannot drift. * * Async with a yield BETWEEN the four CREATE INDEX statements: eac

()

Source from the content-addressed store, hash-verified

342 * stays inside the window.
343 */
344 async endBulkEdgeLoad(): Promise<void> {
345 const schemaPath = path.join(__dirname, 'schema.sql');
346 const schema = fs.readFileSync(schemaPath, 'utf-8');
347 for (const idx of DatabaseConnection.BULK_EDGE_INDEX_NAMES) {
348 const m = schema.match(new RegExp(`CREATE INDEX IF NOT EXISTS ${idx}\\b[^;]*;`));
349 if (!m) throw new Error(`schema.sql: edge index ${idx} not found for bulk-load recreation`);
350 this.db.exec(m[0]);
351 await new Promise((resolve) => setImmediate(resolve));
352 }
353 }
354
355 /** Recreate the FTS triggers + rebuild if a bulk-load window never closed. */
356 private healBulkNodeLoad(): void {

Callers 2

endBulkParseLoadMethod · 0.95

Calls 2

execMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected