( returnedColumns: ColumnReference[], tables: TableSchema[] )
| 101 | } |
| 102 | |
| 103 | function resolveColumnRefsToTableSchemaDescriptor( |
| 104 | returnedColumns: ColumnReference[], |
| 105 | tables: TableSchema[] |
| 106 | ): TableSchemaDescriptor { |
| 107 | let syntheticSchema: TableSchemaDescriptor = {} |
| 108 | |
| 109 | for (const columnRef of returnedColumns) { |
| 110 | if (isAllOfColumnReference(columnRef)) { |
| 111 | const referencedTableSchema = assertIntactTableRef(columnRef, tables) |
| 112 | |
| 113 | syntheticSchema = { |
| 114 | ...syntheticSchema, |
| 115 | ...referencedTableSchema.columnDescriptors |
| 116 | } |
| 117 | } else { |
| 118 | syntheticSchema[columnRef.columnName] = Schema.Any |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | return syntheticSchema |
| 123 | } |
| 124 | |
| 125 | function validateQueryMatchesReturnType( |
| 126 | resultSchema: TableSchemaDescriptor, |
no test coverage detected