| 1 | //===----------------------------------------------------------------------===// |
|---|---|
| 2 | // DuckDB |
| 3 | // |
| 4 | // duckdb/parser/tableref/expressionlistref.hpp |
| 5 | // |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "duckdb/parser/tableref.hpp" |
| 12 | #include "duckdb/parser/parsed_expression.hpp" |
| 13 | #include "duckdb/common/types.hpp" |
| 14 | #include "duckdb/common/vector.hpp" |
| 15 | |
| 16 | namespace duckdb { |
| 17 | //! Represents an expression list as generated by a VALUES statement |
| 18 | class ExpressionListRef : public TableRef { |
| 19 | public: |
| 20 | static constexpr const TableReferenceType TYPE = TableReferenceType::EXPRESSION_LIST; |
| 21 | |
| 22 | public: |
| 23 | ExpressionListRef() : TableRef(TableReferenceType::EXPRESSION_LIST) { |
| 24 | } |
| 25 | |
| 26 | //! Value list, only used for VALUES statement |
| 27 | vector<vector<unique_ptr<ParsedExpression>>> values; |
| 28 | //! Expected SQL types |
| 29 | vector<LogicalType> expected_types; |
| 30 | //! The set of expected names |
| 31 | vector<string> expected_names; |
| 32 | |
| 33 | public: |
| 34 | string ToString() const override; |
| 35 | bool Equals(const TableRef &other_p) const override; |
| 36 | |
| 37 | unique_ptr<TableRef> Copy() override; |
| 38 | |
| 39 | //! Serializes a blob into a ExpressionListRef |
| 40 | void Serialize(FieldWriter &serializer) const override; |
| 41 | //! Deserializes a blob back into a ExpressionListRef |
| 42 | static unique_ptr<TableRef> Deserialize(FieldReader &source); |
| 43 | |
| 44 | void FormatSerialize(FormatSerializer &serializer) const override; |
| 45 | static unique_ptr<TableRef> FormatDeserialize(FormatDeserializer &source); |
| 46 | }; |
| 47 | } // namespace duckdb |
| 48 |