1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/function/table_macro_function.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/function/macro_function.hpp"
12#include "duckdb/parser/query_node.hpp"
13#include "duckdb/function/function.hpp"
14#include "duckdb/main/client_context.hpp"
15#include "duckdb/planner/binder.hpp"
16#include "duckdb/planner/expression_binder.hpp"
17#include "duckdb/parser/expression/constant_expression.hpp"
18
19namespace duckdb {
20
21class TableMacroFunction : public MacroFunction {
22public:
23 static constexpr const MacroType TYPE = MacroType::TABLE_MACRO;
24
25public:
26 explicit TableMacroFunction(unique_ptr<QueryNode> query_node);
27 TableMacroFunction(void);
28
29 //! The main query node
30 unique_ptr<QueryNode> query_node;
31
32public:
33 unique_ptr<MacroFunction> Copy() const override;
34
35 string ToSQL(const string &schema, const string &name) const override;
36
37 static unique_ptr<MacroFunction> Deserialize(FieldReader &reader);
38
39protected:
40 void SerializeInternal(FieldWriter &writer) const override;
41};
42
43} // namespace duckdb
44