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

Method loadResolutionEdges

src/db/queries.ts:5571–5596  ·  view source on GitHub ↗

* Full rows for resolution edges by id, loaded edge-first (CROSS JOIN pins * the join order; left to itself the planner drove the query from the * language index and one rename took 18 s).

(
    language: Language,
    ids: number[]
  )

Source from the content-addressed store, hash-verified

5569 * language index and one rename took 18 s).
5570 */
5571 private loadResolutionEdges(
5572 language: Language,
5573 ids: number[]
5574 ): Array<Edge & { edgeId: number; sourceFilePath: string; sourceLanguage: Language }> {
5575 type Row = EdgeRow & { source_file_path: string; source_language: Language };
5576 const out: Array<Edge & { edgeId: number; sourceFilePath: string; sourceLanguage: Language }> = [];
5577 for (let i = 0; i < ids.length; i += SQLITE_PARAM_CHUNK_SIZE) {
5578 const chunk = ids.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
5579 const rows = this.db
5580 .prepare(
5581 `SELECT e.*, src.file_path AS source_file_path, src.language AS source_language
5582 FROM edges e
5583 CROSS JOIN nodes src ON src.id = e.source
5584 CROSS JOIN nodes tgt ON tgt.id = e.target
5585 WHERE e.id IN (${chunk.map(() => '?').join(',')})
5586 AND src.language = ?
5587 AND e.kind != 'contains'
5588 AND (e.provenance IS NULL OR e.provenance != 'heuristic')`
5589 )
5590 .all(...chunk, language) as Row[];
5591 for (const row of rows) {
5592 out.push({ ...rowToEdge(row), edgeId: row.id, sourceFilePath: row.source_file_path, sourceLanguage: row.source_language });
5593 }
5594 }
5595 return out;
5596 }
5597
5598 /**
5599 * Re-queue a language's parked failures in `names`' files whose reference

Calls 6

rowToEdgeFunction · 0.85
mapMethod · 0.80
pushMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected