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

Method loadResolutionEdges

src/db/queries.ts:5460–5485  ·  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

5458 * language index and one rename took 18 s).
5459 */
5460 private loadResolutionEdges(
5461 language: Language,
5462 ids: number[]
5463 ): Array<Edge & { edgeId: number; sourceFilePath: string; sourceLanguage: Language }> {
5464 type Row = EdgeRow & { source_file_path: string; source_language: Language };
5465 const out: Array<Edge & { edgeId: number; sourceFilePath: string; sourceLanguage: Language }> = [];
5466 for (let i = 0; i < ids.length; i += SQLITE_PARAM_CHUNK_SIZE) {
5467 const chunk = ids.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
5468 const rows = this.db
5469 .prepare(
5470 `SELECT e.*, src.file_path AS source_file_path, src.language AS source_language
5471 FROM edges e
5472 CROSS JOIN nodes src ON src.id = e.source
5473 CROSS JOIN nodes tgt ON tgt.id = e.target
5474 WHERE e.id IN (${chunk.map(() => '?').join(',')})
5475 AND src.language = ?
5476 AND e.kind != 'contains'
5477 AND (e.provenance IS NULL OR e.provenance != 'heuristic')`
5478 )
5479 .all(...chunk, language) as Row[];
5480 for (const row of rows) {
5481 out.push({ ...rowToEdge(row), edgeId: row.id, sourceFilePath: row.source_file_path, sourceLanguage: row.source_language });
5482 }
5483 }
5484 return out;
5485 }
5486
5487 /**
5488 * 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