1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/function/scalar_macro_function.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | //! The SelectStatement of the view |
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 | |
19 | namespace duckdb { |
20 | |
21 | class ScalarMacroFunction : public MacroFunction { |
22 | public: |
23 | static constexpr const MacroType TYPE = MacroType::SCALAR_MACRO; |
24 | |
25 | public: |
26 | explicit ScalarMacroFunction(unique_ptr<ParsedExpression> expression); |
27 | ScalarMacroFunction(void); |
28 | |
29 | //! The macro expression |
30 | unique_ptr<ParsedExpression> expression; |
31 | |
32 | public: |
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 | |
39 | protected: |
40 | void SerializeInternal(FieldWriter &writer) const override; |
41 | }; |
42 | |
43 | } // namespace duckdb |
44 |