1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/parser/tableref/table_function_ref.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/parser/parsed_expression.hpp" |
12 | #include "duckdb/parser/tableref.hpp" |
13 | #include "duckdb/common/vector.hpp" |
14 | #include "duckdb/parser/statement/select_statement.hpp" |
15 | #include "duckdb/main/external_dependencies.hpp" |
16 | |
17 | namespace duckdb { |
18 | //! Represents a Table producing function |
19 | class TableFunctionRef : public TableRef { |
20 | public: |
21 | static constexpr const TableReferenceType TYPE = TableReferenceType::TABLE_FUNCTION; |
22 | |
23 | public: |
24 | DUCKDB_API TableFunctionRef(); |
25 | |
26 | unique_ptr<ParsedExpression> function; |
27 | vector<string> column_name_alias; |
28 | |
29 | // if the function takes a subquery as argument its in here |
30 | unique_ptr<SelectStatement> subquery; |
31 | |
32 | // External dependencies of this table function |
33 | unique_ptr<ExternalDependency> external_dependency; |
34 | |
35 | public: |
36 | string ToString() const override; |
37 | |
38 | bool Equals(const TableRef &other_p) const override; |
39 | |
40 | unique_ptr<TableRef> Copy() override; |
41 | |
42 | //! Serializes a blob into a BaseTableRef |
43 | void Serialize(FieldWriter &serializer) const override; |
44 | //! Deserializes a blob back into a BaseTableRef |
45 | static unique_ptr<TableRef> Deserialize(FieldReader &source); |
46 | |
47 | void FormatSerialize(FormatSerializer &serializer) const override; |
48 | static unique_ptr<TableRef> FormatDeserialize(FormatDeserializer &source); |
49 | }; |
50 | } // namespace duckdb |
51 |