| 1 | //===----------------------------------------------------------------------===// |
|---|---|
| 2 | // DuckDB |
| 3 | // |
| 4 | // duckdb/parser/statement/set_statement.hpp |
| 5 | // |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "duckdb/common/enums/set_scope.hpp" |
| 12 | #include "duckdb/common/enums/set_type.hpp" |
| 13 | #include "duckdb/parser/sql_statement.hpp" |
| 14 | #include "duckdb/common/types/value.hpp" |
| 15 | |
| 16 | namespace duckdb { |
| 17 | |
| 18 | class SetStatement : public SQLStatement { |
| 19 | public: |
| 20 | static constexpr const StatementType TYPE = StatementType::SET_STATEMENT; |
| 21 | |
| 22 | protected: |
| 23 | SetStatement(std::string name_p, SetScope scope_p, SetType type_p); |
| 24 | SetStatement(const SetStatement &other) = default; |
| 25 | |
| 26 | public: |
| 27 | unique_ptr<SQLStatement> Copy() const override; |
| 28 | |
| 29 | public: |
| 30 | std::string name; |
| 31 | SetScope scope; |
| 32 | SetType set_type; |
| 33 | }; |
| 34 | |
| 35 | class SetVariableStatement : public SetStatement { |
| 36 | public: |
| 37 | SetVariableStatement(std::string name_p, Value value_p, SetScope scope_p); |
| 38 | |
| 39 | protected: |
| 40 | SetVariableStatement(const SetVariableStatement &other) = default; |
| 41 | |
| 42 | public: |
| 43 | unique_ptr<SQLStatement> Copy() const override; |
| 44 | |
| 45 | public: |
| 46 | Value value; |
| 47 | }; |
| 48 | |
| 49 | class ResetVariableStatement : public SetStatement { |
| 50 | public: |
| 51 | ResetVariableStatement(std::string name_p, SetScope scope_p); |
| 52 | |
| 53 | protected: |
| 54 | ResetVariableStatement(const ResetVariableStatement &other) = default; |
| 55 | }; |
| 56 | |
| 57 | } // namespace duckdb |
| 58 |