Kùzu C++ API
Loading...
Searching...
No Matches
bound_create_table_info.h
Go to the documentation of this file.
1#pragma once
2
3#include "copy_constructors.h"
4#include "conflict_action.h"
5#include "rel_multiplicity.h"
6#include "table_type.h"
7#include "types.h"
8#include "value.h"
10
11namespace kuzu {
12namespace common {
13enum class RelMultiplicity : uint8_t;
14}
15namespace binder {
18
19 template<class TARGET>
24
25 template<class TARGET>
29
30 virtual void serialize(common::Serializer& serializer) const = 0;
31
32 virtual inline std::unique_ptr<BoundExtraCreateCatalogEntryInfo> copy() const = 0;
33};
34
37 std::string tableName;
39 bool hasParent = false;
40 std::unique_ptr<BoundExtraCreateCatalogEntryInfo> extraInfo;
41
45 std::unique_ptr<BoundExtraCreateCatalogEntryInfo> extraInfo)
47 extraInfo{std::move(extraInfo)} {}
49
50 void serialize(common::Serializer& serializer) const;
52
53private:
55 : type{other.type}, tableName{other.tableName}, onConflict{other.onConflict},
56 hasParent{other.hasParent}, extraInfo{other.extraInfo->copy()} {}
57};
58
60 std::string name;
62 std::unique_ptr<parser::ParsedExpression> defaultValue;
63
64 PropertyInfo() = default;
66 : PropertyInfo{name, std::move(type),
67 std::make_unique<parser::ParsedLiteralExpression>(common::Value::createNullValue(),
68 "NULL")} {}
69
71 std::unique_ptr<parser::ParsedExpression> defaultValue)
72 : name{std::move(name)}, type{std::move(type)}, defaultValue{std::move(defaultValue)} {}
74
75 void serialize(common::Serializer& serializer) const;
77
78private:
79 PropertyInfo(const PropertyInfo& other)
80 : name{other.name}, type{other.type.copy()}, defaultValue{other.defaultValue->copy()} {}
81};
82
84 std::vector<PropertyInfo> propertyInfos;
85
86 explicit BoundExtraCreateTableInfo(std::vector<PropertyInfo> propertyInfos)
87 : propertyInfos{std::move(propertyInfos)} {}
88
90 : BoundExtraCreateTableInfo{copyVector(other.propertyInfos)} {}
92
93 std::unique_ptr<BoundExtraCreateCatalogEntryInfo> copy() const override {
94 return std::make_unique<BoundExtraCreateTableInfo>(*this);
95 }
96
97 void serialize(common::Serializer& serializer) const override;
98 static std::unique_ptr<BoundExtraCreateTableInfo> deserialize(
99 common::Deserializer& deserializer, common::TableType type);
100};
101
104
111
112 std::unique_ptr<BoundExtraCreateCatalogEntryInfo> copy() const override {
113 return std::make_unique<BoundExtraCreateNodeTableInfo>(*this);
114 }
115
116 void serialize(common::Serializer& serializer) const override;
117 static std::unique_ptr<BoundExtraCreateNodeTableInfo> deserialize(
118 common::Deserializer& deserializer);
119};
120
126
128 std::vector<PropertyInfo> propertyInfos)
129 : BoundExtraCreateRelTableInfo{common::RelMultiplicity::MANY, common::RelMultiplicity::MANY,
130 srcTableID, dstTableID, std::move(propertyInfos)} {}
140
141 std::unique_ptr<BoundExtraCreateCatalogEntryInfo> copy() const override {
142 return std::make_unique<BoundExtraCreateRelTableInfo>(*this);
143 }
144
145 void serialize(common::Serializer& serializer) const override;
146 static std::unique_ptr<BoundExtraCreateRelTableInfo> deserialize(
147 common::Deserializer& deserializer);
148};
149
151 std::vector<BoundCreateTableInfo> infos;
152
153 explicit BoundExtraCreateRelTableGroupInfo(std::vector<BoundCreateTableInfo> infos)
154 : infos{std::move(infos)} {}
157
158 inline std::unique_ptr<BoundExtraCreateCatalogEntryInfo> copy() const override {
159 return std::make_unique<BoundExtraCreateRelTableGroupInfo>(*this);
160 }
161
162 void serialize(common::Serializer& serializer) const override;
163 static std::unique_ptr<BoundExtraCreateRelTableGroupInfo> deserialize(
164 common::Deserializer& deserializer);
165};
166
192
193} // namespace binder
194} // namespace kuzu
#define KUZU_API
Definition api.h:25
Definition deserializer.h:15
Definition types.h:201
Definition serializer.h:15
ConflictAction
Definition conflict_action.h:9
RelMultiplicity
Definition rel_multiplicity.h:9
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
TableType
Definition table_type.h:10
Definition alter_type.h:5
Definition bound_create_table_info.h:35
void serialize(common::Serializer &serializer) const
bool hasParent
Definition bound_create_table_info.h:39
static BoundCreateTableInfo deserialize(common::Deserializer &deserializer)
std::string tableName
Definition bound_create_table_info.h:37
common::ConflictAction onConflict
Definition bound_create_table_info.h:38
std::unique_ptr< BoundExtraCreateCatalogEntryInfo > extraInfo
Definition bound_create_table_info.h:40
EXPLICIT_COPY_DEFAULT_MOVE(BoundCreateTableInfo)
common::TableType type
Definition bound_create_table_info.h:36
BoundCreateTableInfo(common::TableType type, std::string tableName, common::ConflictAction onConflict, std::unique_ptr< BoundExtraCreateCatalogEntryInfo > extraInfo)
Definition bound_create_table_info.h:43
Definition bound_create_table_info.h:16
virtual std::unique_ptr< BoundExtraCreateCatalogEntryInfo > copy() const =0
virtual ~BoundExtraCreateCatalogEntryInfo()=default
TARGET * ptrCast()
Definition bound_create_table_info.h:26
virtual void serialize(common::Serializer &serializer) const =0
const TARGET * constPtrCast() const
Definition bound_create_table_info.h:20
Definition bound_create_table_info.h:102
static std::unique_ptr< BoundExtraCreateNodeTableInfo > deserialize(common::Deserializer &deserializer)
void serialize(common::Serializer &serializer) const override
std::unique_ptr< BoundExtraCreateCatalogEntryInfo > copy() const override
Definition bound_create_table_info.h:112
BoundExtraCreateNodeTableInfo(const BoundExtraCreateNodeTableInfo &other)
Definition bound_create_table_info.h:108
common::property_id_t primaryKeyIdx
Definition bound_create_table_info.h:103
BoundExtraCreateNodeTableInfo(common::property_id_t primaryKeyIdx, std::vector< PropertyInfo > propertyInfos)
Definition bound_create_table_info.h:105
Definition bound_create_table_info.h:167
std::unique_ptr< BoundExtraCreateCatalogEntryInfo > copy() const override
Definition bound_create_table_info.h:184
BoundCreateTableInfo literalTripleInfo
Definition bound_create_table_info.h:171
BoundCreateTableInfo resourceTripleInfo
Definition bound_create_table_info.h:170
static std::unique_ptr< BoundExtraCreateRdfGraphInfo > deserialize(common::Deserializer &deserializer)
BoundCreateTableInfo literalInfo
Definition bound_create_table_info.h:169
BoundCreateTableInfo resourceInfo
Definition bound_create_table_info.h:168
BoundExtraCreateRdfGraphInfo(const BoundExtraCreateRdfGraphInfo &other)
Definition bound_create_table_info.h:179
BoundExtraCreateRdfGraphInfo(BoundCreateTableInfo resourceInfo, BoundCreateTableInfo literalInfo, BoundCreateTableInfo resourceTripleInfo, BoundCreateTableInfo literalTripleInfo)
Definition bound_create_table_info.h:173
void serialize(common::Serializer &serializer) const override
Definition bound_create_table_info.h:150
BoundExtraCreateRelTableGroupInfo(const BoundExtraCreateRelTableGroupInfo &other)
Definition bound_create_table_info.h:155
BoundExtraCreateRelTableGroupInfo(std::vector< BoundCreateTableInfo > infos)
Definition bound_create_table_info.h:153
std::unique_ptr< BoundExtraCreateCatalogEntryInfo > copy() const override
Definition bound_create_table_info.h:158
static std::unique_ptr< BoundExtraCreateRelTableGroupInfo > deserialize(common::Deserializer &deserializer)
void serialize(common::Serializer &serializer) const override
std::vector< BoundCreateTableInfo > infos
Definition bound_create_table_info.h:151
Definition bound_create_table_info.h:121
std::unique_ptr< BoundExtraCreateCatalogEntryInfo > copy() const override
Definition bound_create_table_info.h:141
common::RelMultiplicity srcMultiplicity
Definition bound_create_table_info.h:122
BoundExtraCreateRelTableInfo(const BoundExtraCreateRelTableInfo &other)
Definition bound_create_table_info.h:136
static std::unique_ptr< BoundExtraCreateRelTableInfo > deserialize(common::Deserializer &deserializer)
common::table_id_t dstTableID
Definition bound_create_table_info.h:125
common::RelMultiplicity dstMultiplicity
Definition bound_create_table_info.h:123
common::table_id_t srcTableID
Definition bound_create_table_info.h:124
BoundExtraCreateRelTableInfo(common::table_id_t srcTableID, common::table_id_t dstTableID, std::vector< PropertyInfo > propertyInfos)
Definition bound_create_table_info.h:127
BoundExtraCreateRelTableInfo(common::RelMultiplicity srcMultiplicity, common::RelMultiplicity dstMultiplicity, common::table_id_t srcTableID, common::table_id_t dstTableID, std::vector< PropertyInfo > propertyInfos)
Definition bound_create_table_info.h:131
void serialize(common::Serializer &serializer) const override
Definition bound_create_table_info.h:83
BoundExtraCreateTableInfo(std::vector< PropertyInfo > propertyInfos)
Definition bound_create_table_info.h:86
static std::unique_ptr< BoundExtraCreateTableInfo > deserialize(common::Deserializer &deserializer, common::TableType type)
BoundExtraCreateTableInfo(const BoundExtraCreateTableInfo &other)
Definition bound_create_table_info.h:89
BoundExtraCreateTableInfo & operator=(const BoundExtraCreateTableInfo &)=delete
void serialize(common::Serializer &serializer) const override
std::vector< PropertyInfo > propertyInfos
Definition bound_create_table_info.h:84
std::unique_ptr< BoundExtraCreateCatalogEntryInfo > copy() const override
Definition bound_create_table_info.h:93
Definition bound_create_table_info.h:59
PropertyInfo(std::string name, common::LogicalType type, std::unique_ptr< parser::ParsedExpression > defaultValue)
Definition bound_create_table_info.h:70
void serialize(common::Serializer &serializer) const
common::LogicalType type
Definition bound_create_table_info.h:61
std::string name
Definition bound_create_table_info.h:60
static PropertyInfo deserialize(common::Deserializer &deserializer)
EXPLICIT_COPY_DEFAULT_MOVE(PropertyInfo)
PropertyInfo(std::string name, common::LogicalType type)
Definition bound_create_table_info.h:65
std::unique_ptr< parser::ParsedExpression > defaultValue
Definition bound_create_table_info.h:62