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

Function resolveSubqueryToTableSchema

src/validation.ts:154–166  ·  view source on GitHub ↗
(
  query: Query & { exposedAsTable: string },
  tables: TableSchema[]
)

Source from the content-addressed store, hash-verified

152}
153
154function resolveSubqueryToTableSchema(
155 query: Query & { exposedAsTable: string },
156 tables: TableSchema[]
157): TableSchema {
158 const schema = resolveColumnRefsToTableSchemaDescriptor(query.returnedColumns, tables)
159 return {
160 tableName: query.exposedAsTable,
161 columnDescriptors: schema,
162 columnNames: Object.keys(schema),
163 loc: query.path.node.loc,
164 sourceFile: query.sourceFile
165 }
166}
167
168function validateSubquery(query: Query, tables: TableSchema[]) {
169 try {

Callers 1

validateQueryFunction · 0.85

Tested by

no test coverage detected