MCPcopy Create free account
hub / github.com/andywer/postguard / getTableByName

Function getTableByName

src/resolver.ts:13–24  ·  view source on GitHub ↗
(tables: TableSchema[], tableName: string)

Source from the content-addressed store, hash-verified

11}
12
13function getTableByName(tables: TableSchema[], tableName: string): TableSchema {
14 const table = tables.find(schema => schema.tableName === tableName)
15
16 if (!table) {
17 const tableNames = tables.map(schema => `"${schema.tableName}"`)
18 throw new Error(
19 `No table named "${tableName}" found. Known tables in scope: ${tableNames.join(", ")}`
20 )
21 }
22
23 return table
24}
25
26export function resolveUnqualifiedColumnRef(
27 columnRef: UnqualifiedColumnReference,

Callers 2

resolveTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected