1 | #include "duckdb/common/exception.hpp" |
---|---|
2 | #include "duckdb/parser/tableref.hpp" |
3 | #include "duckdb/parser/transformer.hpp" |
4 | |
5 | namespace duckdb { |
6 | |
7 | unique_ptr<TableRef> Transformer::TransformTableRefNode(duckdb_libpgquery::PGNode &n) { |
8 | auto stack_checker = StackCheck(); |
9 | |
10 | switch (n.type) { |
11 | case duckdb_libpgquery::T_PGRangeVar: |
12 | return TransformRangeVar(root&: PGCast<duckdb_libpgquery::PGRangeVar>(node&: n)); |
13 | case duckdb_libpgquery::T_PGJoinExpr: |
14 | return TransformJoin(root&: PGCast<duckdb_libpgquery::PGJoinExpr>(node&: n)); |
15 | case duckdb_libpgquery::T_PGRangeSubselect: |
16 | return TransformRangeSubselect(root&: PGCast<duckdb_libpgquery::PGRangeSubselect>(node&: n)); |
17 | case duckdb_libpgquery::T_PGRangeFunction: |
18 | return TransformRangeFunction(root&: PGCast<duckdb_libpgquery::PGRangeFunction>(node&: n)); |
19 | case duckdb_libpgquery::T_PGPivotExpr: |
20 | return TransformPivot(root&: PGCast<duckdb_libpgquery::PGPivotExpr>(node&: n)); |
21 | default: |
22 | throw NotImplementedException("From Type %d not supported", n.type); |
23 | } |
24 | } |
25 | |
26 | } // namespace duckdb |
27 |