1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/planner/operator/logical_create.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/planner/logical_operator.hpp"
12#include "duckdb/parser/parsed_data/create_info.hpp"
13
14namespace duckdb {
15
16//! LogicalCreate represents a CREATE operator
17class LogicalCreate : public LogicalOperator {
18public:
19 static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_INVALID;
20
21public:
22 LogicalCreate(LogicalOperatorType type, unique_ptr<CreateInfo> info,
23 optional_ptr<SchemaCatalogEntry> schema = nullptr)
24 : LogicalOperator(type), schema(schema), info(std::move(info)) {
25 }
26
27 optional_ptr<SchemaCatalogEntry> schema;
28 unique_ptr<CreateInfo> info;
29
30public:
31 void Serialize(FieldWriter &writer) const override;
32 static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
33 idx_t EstimateCardinality(ClientContext &context) override;
34
35protected:
36 void ResolveTypes() override {
37 types.emplace_back(args: LogicalType::BIGINT);
38 }
39};
40} // namespace duckdb
41