Kùzu C++ API
Loading...
Searching...
No Matches
bound_alter_info.h
Go to the documentation of this file.
1#pragma once
2
3#include "expression.h"
4#include "alter_type.h"
5#include "parsed_expression.h"
6
7namespace kuzu {
8namespace binder {
9
11 virtual ~BoundExtraAlterInfo() = default;
12
13 template<class TARGET>
17 template<class TARGET>
21
22 virtual std::unique_ptr<BoundExtraAlterInfo> copy() const = 0;
23};
24
27 std::string tableName;
29 std::unique_ptr<BoundExtraAlterInfo> extraInfo;
30
32 std::unique_ptr<BoundExtraAlterInfo> extraInfo)
34 extraInfo{std::move(extraInfo)} {}
36
37private:
38 BoundAlterInfo(const BoundAlterInfo& other)
39 : alterType{other.alterType}, tableName{other.tableName}, tableID{other.tableID},
40 extraInfo{other.extraInfo->copy()} {}
41};
42
44 std::string newName;
45
46 explicit BoundExtraRenameTableInfo(std::string newName) : newName{std::move(newName)} {}
48
49 inline std::unique_ptr<BoundExtraAlterInfo> copy() const final {
50 return std::make_unique<BoundExtraRenameTableInfo>(*this);
51 }
52};
53
55 std::string propertyName;
57 std::unique_ptr<parser::ParsedExpression> defaultValue;
58 std::shared_ptr<Expression> boundDefault;
59
61 std::unique_ptr<parser::ParsedExpression> defaultValue,
62 std::shared_ptr<Expression> boundDefault)
63 : propertyName{std::move(propertyName)}, dataType{std::move(dataType)},
64 defaultValue{std::move(defaultValue)}, boundDefault{std::move(boundDefault)} {}
68
69 inline std::unique_ptr<BoundExtraAlterInfo> copy() const final {
70 return std::make_unique<BoundExtraAddPropertyInfo>(*this);
71 }
72};
73
76 std::string propertyName;
77
82
83 inline std::unique_ptr<BoundExtraAlterInfo> copy() const final {
84 return std::make_unique<BoundExtraDropPropertyInfo>(*this);
85 }
86};
87
90 std::string newName;
91 std::string oldName;
92
98 inline std::unique_ptr<BoundExtraAlterInfo> copy() const final {
99 return std::make_unique<BoundExtraRenamePropertyInfo>(*this);
100 }
101};
102
104 std::string comment;
105
106 explicit BoundExtraCommentInfo(std::string comment) : comment{std::move(comment)} {}
108 inline std::unique_ptr<BoundExtraAlterInfo> copy() const final {
109 return std::make_unique<BoundExtraCommentInfo>(*this);
110 }
111};
112
113} // namespace binder
114} // namespace kuzu
Definition types.h:201
AlterType
Definition alter_type.h:8
uint32_t property_id_t
Definition types.h:34
uint64_t table_id_t
Definition internal_id_t.h:14
TO ku_dynamic_cast(FROM old)
Definition cast.h:11
Definition alter_type.h:5
Definition bound_alter_info.h:25
BoundAlterInfo(common::AlterType alterType, std::string tableName, common::table_id_t tableID, std::unique_ptr< BoundExtraAlterInfo > extraInfo)
Definition bound_alter_info.h:31
EXPLICIT_COPY_DEFAULT_MOVE(BoundAlterInfo)
std::string tableName
Definition bound_alter_info.h:27
common::table_id_t tableID
Definition bound_alter_info.h:28
std::unique_ptr< BoundExtraAlterInfo > extraInfo
Definition bound_alter_info.h:29
common::AlterType alterType
Definition bound_alter_info.h:26
Definition bound_alter_info.h:54
std::unique_ptr< BoundExtraAlterInfo > copy() const final
Definition bound_alter_info.h:69
std::shared_ptr< Expression > boundDefault
Definition bound_alter_info.h:58
std::string propertyName
Definition bound_alter_info.h:55
std::unique_ptr< parser::ParsedExpression > defaultValue
Definition bound_alter_info.h:57
BoundExtraAddPropertyInfo(std::string propertyName, common::LogicalType dataType, std::unique_ptr< parser::ParsedExpression > defaultValue, std::shared_ptr< Expression > boundDefault)
Definition bound_alter_info.h:60
common::LogicalType dataType
Definition bound_alter_info.h:56
BoundExtraAddPropertyInfo(const BoundExtraAddPropertyInfo &other)
Definition bound_alter_info.h:65
Definition bound_alter_info.h:10
virtual ~BoundExtraAlterInfo()=default
const TARGET * constPtrCast() const
Definition bound_alter_info.h:14
virtual std::unique_ptr< BoundExtraAlterInfo > copy() const =0
const TARGET & constCast() const
Definition bound_alter_info.h:18
Definition bound_alter_info.h:103
std::string comment
Definition bound_alter_info.h:104
BoundExtraCommentInfo(std::string comment)
Definition bound_alter_info.h:106
BoundExtraCommentInfo(const BoundExtraCommentInfo &other)
Definition bound_alter_info.h:107
std::unique_ptr< BoundExtraAlterInfo > copy() const final
Definition bound_alter_info.h:108
Definition bound_alter_info.h:74
std::string propertyName
Definition bound_alter_info.h:76
std::unique_ptr< BoundExtraAlterInfo > copy() const final
Definition bound_alter_info.h:83
BoundExtraDropPropertyInfo(const BoundExtraDropPropertyInfo &other)
Definition bound_alter_info.h:80
common::property_id_t propertyID
Definition bound_alter_info.h:75
BoundExtraDropPropertyInfo(common::property_id_t propertyID, std::string propertyName)
Definition bound_alter_info.h:78
Definition bound_alter_info.h:88
std::string oldName
Definition bound_alter_info.h:91
BoundExtraRenamePropertyInfo(const BoundExtraRenamePropertyInfo &other)
Definition bound_alter_info.h:96
std::string newName
Definition bound_alter_info.h:90
std::unique_ptr< BoundExtraAlterInfo > copy() const final
Definition bound_alter_info.h:98
common::property_id_t propertyID
Definition bound_alter_info.h:89
BoundExtraRenamePropertyInfo(common::property_id_t propertyID, std::string newName, std::string oldName)
Definition bound_alter_info.h:93
Definition bound_alter_info.h:43
BoundExtraRenameTableInfo(std::string newName)
Definition bound_alter_info.h:46
std::unique_ptr< BoundExtraAlterInfo > copy() const final
Definition bound_alter_info.h:49
BoundExtraRenameTableInfo(const BoundExtraRenameTableInfo &other)
Definition bound_alter_info.h:47
std::string newName
Definition bound_alter_info.h:44