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

Function assertIntactTableRef

src/validation.ts:43–49  ·  view source on GitHub ↗
(tableRef: TableReference, tables: TableSchema[])

Source from the content-addressed store, hash-verified

41}
42
43function assertIntactTableRef(tableRef: TableReference, tables: TableSchema[]) {
44 const tableSchema = tables.find(schema => schema.tableName === tableRef.tableName)
45 if (!tableSchema) {
46 throw new Error(`No table with name "${tableRef.tableName}" has been defined.`)
47 }
48 return tableSchema
49}
50
51function assertNoBrokenColumnRefs(query: Query, tables: TableSchema[]) {
52 const referencedColumns = resolveColumnReferences(query, tables)

Calls

no outgoing calls

Tested by

no test coverage detected