1 | //===----------------------------------------------------------------------===// |
2 | // DuckDB |
3 | // |
4 | // duckdb/main/relation/table_function_relation.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/main/relation.hpp" |
12 | |
13 | namespace duckdb { |
14 | |
15 | class TableFunctionRelation : public Relation { |
16 | public: |
17 | TableFunctionRelation(const std::shared_ptr<ClientContext> &context, string name, vector<Value> parameters, |
18 | named_parameter_map_t named_parameters, shared_ptr<Relation> input_relation_p = nullptr, |
19 | bool auto_init = true); |
20 | |
21 | TableFunctionRelation(const std::shared_ptr<ClientContext> &context, string name, vector<Value> parameters, |
22 | shared_ptr<Relation> input_relation_p = nullptr, bool auto_init = true); |
23 | |
24 | string name; |
25 | vector<Value> parameters; |
26 | named_parameter_map_t named_parameters; |
27 | vector<ColumnDefinition> columns; |
28 | shared_ptr<Relation> input_relation; |
29 | |
30 | public: |
31 | unique_ptr<QueryNode> GetQueryNode() override; |
32 | unique_ptr<TableRef> GetTableRef() override; |
33 | |
34 | const vector<ColumnDefinition> &Columns() override; |
35 | string ToString(idx_t depth) override; |
36 | string GetAlias() override; |
37 | void AddNamedParameter(const string &name, Value argument); |
38 | |
39 | private: |
40 | void InitializeColumns(); |
41 | |
42 | private: |
43 | //! Whether or not to auto initialize the columns on construction |
44 | bool auto_initialize; |
45 | }; |
46 | |
47 | } // namespace duckdb |
48 | |