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

Method getImportNodesByNames

src/db/queries.ts:4007–4018  ·  view source on GitHub ↗

The import nodes named one of `names` (an import node is named by the module path it imports).

(names: string[])

Source from the content-addressed store, hash-verified

4005
4006 /** The import nodes named one of `names` (an import node is named by the module path it imports). */
4007 getImportNodesByNames(names: string[]): Array<{ filePath: string; name: string; language: Language }> {
4008 const out: Array<{ filePath: string; name: string; language: Language }> = [];
4009 for (let i = 0; i < names.length; i += SQLITE_PARAM_CHUNK_SIZE) {
4010 const chunk = names.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
4011 const placeholders = chunk.map(() => '?').join(',');
4012 const rows = this.db
4013 .prepare(`SELECT file_path, name, language FROM nodes WHERE name IN (${placeholders}) AND kind = 'import'`)
4014 .all(...chunk) as Array<{ file_path: string; name: string; language: Language }>;
4015 for (const row of rows) out.push({ filePath: row.file_path, name: row.name, language: row.language });
4016 }
4017 return out;
4018 }
4019
4020 // ===========================================================================
4021 // File Operations

Callers 1

addPythonImportersFunction · 0.80

Calls 5

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

Tested by

no test coverage detected