1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/planner/operator/logical_set.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/common/enums/set_scope.hpp"
12#include "duckdb/parser/parsed_data/copy_info.hpp"
13#include "duckdb/planner/logical_operator.hpp"
14#include "duckdb/function/copy_function.hpp"
15
16namespace duckdb {
17
18class LogicalSet : public LogicalOperator {
19public:
20 static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_SET;
21
22public:
23 LogicalSet(std::string name_p, Value value_p, SetScope scope_p)
24 : LogicalOperator(LogicalOperatorType::LOGICAL_SET), name(name_p), value(value_p), scope(scope_p) {
25 }
26
27 std::string name;
28 Value value;
29 SetScope scope;
30
31public:
32 void Serialize(FieldWriter &writer) const override;
33 static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
34 idx_t EstimateCardinality(ClientContext &context) override;
35
36protected:
37 void ResolveTypes() override {
38 types.emplace_back(args: LogicalType::BOOLEAN);
39 }
40};
41
42} // namespace duckdb
43