(tables: TableSchema[], tableName: string)
| 11 | } |
| 12 | |
| 13 | function 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 | |
| 26 | export function resolveUnqualifiedColumnRef( |
| 27 | columnRef: UnqualifiedColumnReference, |
no outgoing calls
no test coverage detected