MCPcopy Create free account
hub / github.com/bytebase/dbhub / buildSourceDisplayInfo

Function buildSourceDisplayInfo

src/utils/startup-table.ts:177–195  ·  view source on GitHub ↗
(
  sourceConfigs: SourceConfig[],
  getToolsForSource: (sourceId: string) => string[],
  isDemo: boolean
)

Source from the content-addressed store, hash-verified

175 * Build SourceDisplayInfo from source configs and tool names
176 */
177export function buildSourceDisplayInfo(
178 sourceConfigs: SourceConfig[],
179 getToolsForSource: (sourceId: string) => string[],
180 isDemo: boolean
181): SourceDisplayInfo[] {
182 return sourceConfigs.map((source) => {
183 const { host, database } = parseHostAndDatabase(source);
184
185 return {
186 id: source.id,
187 type: source.type || "sqlite",
188 host,
189 database,
190 readonly: source.readonly || false,
191 isDemo,
192 tools: getToolsForSource(source.id),
193 };
194 });
195}

Callers 1

mainFunction · 0.85

Calls 2

parseHostAndDatabaseFunction · 0.85
getToolsForSourceFunction · 0.85

Tested by

no test coverage detected