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

Method getImportNodesByNames

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

4116
4117 /** The import nodes named one of `names` (an import node is named by the module path it imports). */
4118 getImportNodesByNames(names: string[]): Array<{ filePath: string; name: string; language: Language }> {
4119 const out: Array<{ filePath: string; name: string; language: Language }> = [];
4120 for (let i = 0; i < names.length; i += SQLITE_PARAM_CHUNK_SIZE) {
4121 const chunk = names.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
4122 const placeholders = chunk.map(() => '?').join(',');
4123 const rows = this.db
4124 .prepare(`SELECT file_path, name, language FROM nodes WHERE name IN (${placeholders}) AND kind = 'import'`)
4125 .all(...chunk) as Array<{ file_path: string; name: string; language: Language }>;
4126 for (const row of rows) out.push({ filePath: row.file_path, name: row.name, language: row.language });
4127 }
4128 return out;
4129 }
4130
4131 // ===========================================================================
4132 // 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