feat: create schema with options (#93)
* chore: add options to create database expr * chore: rebase develop
This commit is contained in:
+158
-44
@@ -140,9 +140,21 @@ struct CompactTableExprDefaultTypeInternal {
|
||||
};
|
||||
};
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompactTableExprDefaultTypeInternal _CompactTableExpr_default_instance_;
|
||||
PROTOBUF_CONSTEXPR CreateDatabaseExpr_OptionsEntry_DoNotUse::CreateDatabaseExpr_OptionsEntry_DoNotUse(
|
||||
::_pbi::ConstantInitialized) {}
|
||||
struct CreateDatabaseExpr_OptionsEntry_DoNotUseDefaultTypeInternal {
|
||||
PROTOBUF_CONSTEXPR CreateDatabaseExpr_OptionsEntry_DoNotUseDefaultTypeInternal()
|
||||
: _instance(::_pbi::ConstantInitialized{}) {}
|
||||
~CreateDatabaseExpr_OptionsEntry_DoNotUseDefaultTypeInternal() {}
|
||||
union {
|
||||
CreateDatabaseExpr_OptionsEntry_DoNotUse _instance;
|
||||
};
|
||||
};
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateDatabaseExpr_OptionsEntry_DoNotUseDefaultTypeInternal _CreateDatabaseExpr_OptionsEntry_DoNotUse_default_instance_;
|
||||
PROTOBUF_CONSTEXPR CreateDatabaseExpr::CreateDatabaseExpr(
|
||||
::_pbi::ConstantInitialized): _impl_{
|
||||
/*decltype(_impl_.database_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
|
||||
/*decltype(_impl_.options_)*/{::_pbi::ConstantInitialized()}
|
||||
, /*decltype(_impl_.database_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
|
||||
, /*decltype(_impl_.create_if_not_exists_)*/false
|
||||
, /*decltype(_impl_._cached_size_)*/{}} {}
|
||||
struct CreateDatabaseExprDefaultTypeInternal {
|
||||
@@ -266,7 +278,7 @@ struct TableIdDefaultTypeInternal {
|
||||
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TableIdDefaultTypeInternal _TableId_default_instance_;
|
||||
} // namespace v1
|
||||
} // namespace greptime
|
||||
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fddl_2eproto[16];
|
||||
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fddl_2eproto[17];
|
||||
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fddl_2eproto[1];
|
||||
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fddl_2eproto = nullptr;
|
||||
|
||||
@@ -359,6 +371,16 @@ const uint32_t TableStruct_greptime_2fv1_2fddl_2eproto::offsets[] PROTOBUF_SECTI
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CompactTableExpr, _impl_.schema_name_),
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CompactTableExpr, _impl_.table_name_),
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CompactTableExpr, _impl_.region_number_),
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse, _has_bits_),
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
~0u, // no _oneof_case_
|
||||
~0u, // no _weak_field_map_
|
||||
~0u, // no _inlined_string_donated_
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse, key_),
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse, value_),
|
||||
0,
|
||||
1,
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CreateDatabaseExpr, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
@@ -367,6 +389,7 @@ const uint32_t TableStruct_greptime_2fv1_2fddl_2eproto::offsets[] PROTOBUF_SECTI
|
||||
~0u, // no _inlined_string_donated_
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CreateDatabaseExpr, _impl_.database_name_),
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CreateDatabaseExpr, _impl_.create_if_not_exists_),
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::CreateDatabaseExpr, _impl_.options_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::greptime::v1::TruncateTableExpr, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
@@ -438,15 +461,16 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode
|
||||
{ 57, -1, -1, sizeof(::greptime::v1::DropTableExpr)},
|
||||
{ 67, -1, -1, sizeof(::greptime::v1::FlushTableExpr)},
|
||||
{ 78, -1, -1, sizeof(::greptime::v1::CompactTableExpr)},
|
||||
{ 88, -1, -1, sizeof(::greptime::v1::CreateDatabaseExpr)},
|
||||
{ 96, -1, -1, sizeof(::greptime::v1::TruncateTableExpr)},
|
||||
{ 106, -1, -1, sizeof(::greptime::v1::AddColumns)},
|
||||
{ 113, -1, -1, sizeof(::greptime::v1::DropColumns)},
|
||||
{ 120, -1, -1, sizeof(::greptime::v1::RenameTable)},
|
||||
{ 127, -1, -1, sizeof(::greptime::v1::AddColumn_Location)},
|
||||
{ 135, -1, -1, sizeof(::greptime::v1::AddColumn)},
|
||||
{ 144, -1, -1, sizeof(::greptime::v1::DropColumn)},
|
||||
{ 151, -1, -1, sizeof(::greptime::v1::TableId)},
|
||||
{ 88, 96, -1, sizeof(::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse)},
|
||||
{ 98, -1, -1, sizeof(::greptime::v1::CreateDatabaseExpr)},
|
||||
{ 107, -1, -1, sizeof(::greptime::v1::TruncateTableExpr)},
|
||||
{ 117, -1, -1, sizeof(::greptime::v1::AddColumns)},
|
||||
{ 124, -1, -1, sizeof(::greptime::v1::DropColumns)},
|
||||
{ 131, -1, -1, sizeof(::greptime::v1::RenameTable)},
|
||||
{ 138, -1, -1, sizeof(::greptime::v1::AddColumn_Location)},
|
||||
{ 146, -1, -1, sizeof(::greptime::v1::AddColumn)},
|
||||
{ 155, -1, -1, sizeof(::greptime::v1::DropColumn)},
|
||||
{ 162, -1, -1, sizeof(::greptime::v1::TableId)},
|
||||
};
|
||||
|
||||
static const ::_pb::Message* const file_default_instances[] = {
|
||||
@@ -457,6 +481,7 @@ static const ::_pb::Message* const file_default_instances[] = {
|
||||
&::greptime::v1::_DropTableExpr_default_instance_._instance,
|
||||
&::greptime::v1::_FlushTableExpr_default_instance_._instance,
|
||||
&::greptime::v1::_CompactTableExpr_default_instance_._instance,
|
||||
&::greptime::v1::_CreateDatabaseExpr_OptionsEntry_DoNotUse_default_instance_._instance,
|
||||
&::greptime::v1::_CreateDatabaseExpr_default_instance_._instance,
|
||||
&::greptime::v1::_TruncateTableExpr_default_instance_._instance,
|
||||
&::greptime::v1::_AddColumns_default_instance_._instance,
|
||||
@@ -507,35 +532,38 @@ const char descriptor_table_protodef_greptime_2fv1_2fddl_2eproto[] PROTOBUF_SECT
|
||||
"able_id\030\005 \001(\0132\024.greptime.v1.TableId\"h\n\020C"
|
||||
"ompactTableExpr\022\024\n\014catalog_name\030\001 \001(\t\022\023\n"
|
||||
"\013schema_name\030\002 \001(\t\022\022\n\ntable_name\030\003 \001(\t\022\025"
|
||||
"\n\rregion_number\030\004 \001(\r\"I\n\022CreateDatabaseE"
|
||||
"xpr\022\025\n\rdatabase_name\030\001 \001(\t\022\034\n\024create_if_"
|
||||
"not_exists\030\002 \001(\010\"z\n\021TruncateTableExpr\022\024\n"
|
||||
"\014catalog_name\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t"
|
||||
"\022\022\n\ntable_name\030\003 \001(\t\022&\n\010table_id\030\004 \001(\0132\024"
|
||||
".greptime.v1.TableId\"9\n\nAddColumns\022+\n\013ad"
|
||||
"d_columns\030\001 \003(\0132\026.greptime.v1.AddColumn\""
|
||||
"<\n\013DropColumns\022-\n\014drop_columns\030\001 \003(\0132\027.g"
|
||||
"reptime.v1.DropColumn\"%\n\013RenameTable\022\026\n\016"
|
||||
"new_table_name\030\001 \001(\t\"\215\002\n\tAddColumn\022*\n\nco"
|
||||
"lumn_def\030\001 \001(\0132\026.greptime.v1.ColumnDef\022\016"
|
||||
"\n\006is_key\030\002 \001(\010\0221\n\010location\030\003 \001(\0132\037.grept"
|
||||
"ime.v1.AddColumn.Location\032\220\001\n\010Location\022C"
|
||||
"\n\rlocation_type\030\001 \001(\0162,.greptime.v1.AddC"
|
||||
"olumn.Location.LocationType\022\031\n\021after_clo"
|
||||
"umn_name\030\002 \001(\t\"$\n\014LocationType\022\t\n\005FIRST\020"
|
||||
"\000\022\t\n\005AFTER\020\001\"\032\n\nDropColumn\022\014\n\004name\030\001 \001(\t"
|
||||
"\"\025\n\007TableId\022\n\n\002id\030\001 \001(\rBL\n\016io.greptime.v"
|
||||
"1B\003DdlZ5github.com/GreptimeTeam/greptime"
|
||||
"-proto/go/greptime/v1b\006proto3"
|
||||
"\n\rregion_number\030\004 \001(\r\"\270\001\n\022CreateDatabase"
|
||||
"Expr\022\025\n\rdatabase_name\030\001 \001(\t\022\034\n\024create_if"
|
||||
"_not_exists\030\002 \001(\010\022=\n\007options\030\003 \003(\0132,.gre"
|
||||
"ptime.v1.CreateDatabaseExpr.OptionsEntry"
|
||||
"\032.\n\014OptionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002"
|
||||
" \001(\t:\0028\001\"z\n\021TruncateTableExpr\022\024\n\014catalog"
|
||||
"_name\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\022\n\ntabl"
|
||||
"e_name\030\003 \001(\t\022&\n\010table_id\030\004 \001(\0132\024.greptim"
|
||||
"e.v1.TableId\"9\n\nAddColumns\022+\n\013add_column"
|
||||
"s\030\001 \003(\0132\026.greptime.v1.AddColumn\"<\n\013DropC"
|
||||
"olumns\022-\n\014drop_columns\030\001 \003(\0132\027.greptime."
|
||||
"v1.DropColumn\"%\n\013RenameTable\022\026\n\016new_tabl"
|
||||
"e_name\030\001 \001(\t\"\215\002\n\tAddColumn\022*\n\ncolumn_def"
|
||||
"\030\001 \001(\0132\026.greptime.v1.ColumnDef\022\016\n\006is_key"
|
||||
"\030\002 \001(\010\0221\n\010location\030\003 \001(\0132\037.greptime.v1.A"
|
||||
"ddColumn.Location\032\220\001\n\010Location\022C\n\rlocati"
|
||||
"on_type\030\001 \001(\0162,.greptime.v1.AddColumn.Lo"
|
||||
"cation.LocationType\022\031\n\021after_cloumn_name"
|
||||
"\030\002 \001(\t\"$\n\014LocationType\022\t\n\005FIRST\020\000\022\t\n\005AFT"
|
||||
"ER\020\001\"\032\n\nDropColumn\022\014\n\004name\030\001 \001(\t\"\025\n\007Tabl"
|
||||
"eId\022\n\n\002id\030\001 \001(\rBL\n\016io.greptime.v1B\003DdlZ5"
|
||||
"github.com/GreptimeTeam/greptime-proto/g"
|
||||
"o/greptime/v1b\006proto3"
|
||||
;
|
||||
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fddl_2eproto_deps[1] = {
|
||||
&::descriptor_table_greptime_2fv1_2fcommon_2eproto,
|
||||
};
|
||||
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fddl_2eproto_once;
|
||||
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fddl_2eproto = {
|
||||
false, false, 2309, descriptor_table_protodef_greptime_2fv1_2fddl_2eproto,
|
||||
false, false, 2421, descriptor_table_protodef_greptime_2fv1_2fddl_2eproto,
|
||||
"greptime/v1/ddl.proto",
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_once, descriptor_table_greptime_2fv1_2fddl_2eproto_deps, 1, 16,
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_once, descriptor_table_greptime_2fv1_2fddl_2eproto_deps, 1, 17,
|
||||
schemas, file_default_instances, TableStruct_greptime_2fv1_2fddl_2eproto::offsets,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto, file_level_enum_descriptors_greptime_2fv1_2fddl_2eproto,
|
||||
file_level_service_descriptors_greptime_2fv1_2fddl_2eproto,
|
||||
@@ -3532,6 +3560,20 @@ void CompactTableExpr::InternalSwap(CompactTableExpr* other) {
|
||||
|
||||
// ===================================================================
|
||||
|
||||
CreateDatabaseExpr_OptionsEntry_DoNotUse::CreateDatabaseExpr_OptionsEntry_DoNotUse() {}
|
||||
CreateDatabaseExpr_OptionsEntry_DoNotUse::CreateDatabaseExpr_OptionsEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
|
||||
: SuperType(arena) {}
|
||||
void CreateDatabaseExpr_OptionsEntry_DoNotUse::MergeFrom(const CreateDatabaseExpr_OptionsEntry_DoNotUse& other) {
|
||||
MergeFromInternal(other);
|
||||
}
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata CreateDatabaseExpr_OptionsEntry_DoNotUse::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[7]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class CreateDatabaseExpr::_Internal {
|
||||
public:
|
||||
};
|
||||
@@ -3540,17 +3582,22 @@ CreateDatabaseExpr::CreateDatabaseExpr(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
|
||||
SharedCtor(arena, is_message_owned);
|
||||
if (arena != nullptr && !is_message_owned) {
|
||||
arena->OwnCustomDestructor(this, &CreateDatabaseExpr::ArenaDtor);
|
||||
}
|
||||
// @@protoc_insertion_point(arena_constructor:greptime.v1.CreateDatabaseExpr)
|
||||
}
|
||||
CreateDatabaseExpr::CreateDatabaseExpr(const CreateDatabaseExpr& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message() {
|
||||
CreateDatabaseExpr* const _this = this; (void)_this;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.database_name_){}
|
||||
/*decltype(_impl_.options_)*/{}
|
||||
, decltype(_impl_.database_name_){}
|
||||
, decltype(_impl_.create_if_not_exists_){}
|
||||
, /*decltype(_impl_._cached_size_)*/{}};
|
||||
|
||||
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
|
||||
_this->_impl_.options_.MergeFrom(from._impl_.options_);
|
||||
_impl_.database_name_.InitDefault();
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
_impl_.database_name_.Set("", GetArenaForAllocation());
|
||||
@@ -3568,7 +3615,8 @@ inline void CreateDatabaseExpr::SharedCtor(
|
||||
(void)arena;
|
||||
(void)is_message_owned;
|
||||
new (&_impl_) Impl_{
|
||||
decltype(_impl_.database_name_){}
|
||||
/*decltype(_impl_.options_)*/{::_pbi::ArenaInitialized(), arena}
|
||||
, decltype(_impl_.database_name_){}
|
||||
, decltype(_impl_.create_if_not_exists_){false}
|
||||
, /*decltype(_impl_._cached_size_)*/{}
|
||||
};
|
||||
@@ -3582,6 +3630,7 @@ CreateDatabaseExpr::~CreateDatabaseExpr() {
|
||||
// @@protoc_insertion_point(destructor:greptime.v1.CreateDatabaseExpr)
|
||||
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
|
||||
(void)arena;
|
||||
ArenaDtor(this);
|
||||
return;
|
||||
}
|
||||
SharedDtor();
|
||||
@@ -3589,9 +3638,15 @@ CreateDatabaseExpr::~CreateDatabaseExpr() {
|
||||
|
||||
inline void CreateDatabaseExpr::SharedDtor() {
|
||||
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
|
||||
_impl_.options_.Destruct();
|
||||
_impl_.options_.~MapField();
|
||||
_impl_.database_name_.Destroy();
|
||||
}
|
||||
|
||||
void CreateDatabaseExpr::ArenaDtor(void* object) {
|
||||
CreateDatabaseExpr* _this = reinterpret_cast< CreateDatabaseExpr* >(object);
|
||||
_this->_impl_.options_.Destruct();
|
||||
}
|
||||
void CreateDatabaseExpr::SetCachedSize(int size) const {
|
||||
_impl_._cached_size_.Set(size);
|
||||
}
|
||||
@@ -3602,6 +3657,7 @@ void CreateDatabaseExpr::Clear() {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
_impl_.options_.Clear();
|
||||
_impl_.database_name_.ClearToEmpty();
|
||||
_impl_.create_if_not_exists_ = false;
|
||||
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
|
||||
@@ -3631,6 +3687,19 @@ const char* CreateDatabaseExpr::_InternalParse(const char* ptr, ::_pbi::ParseCon
|
||||
} else
|
||||
goto handle_unusual;
|
||||
continue;
|
||||
// map<string, string> options = 3;
|
||||
case 3:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
|
||||
ptr -= 1;
|
||||
do {
|
||||
ptr += 1;
|
||||
ptr = ctx->ParseMessage(&_impl_.options_, ptr);
|
||||
CHK_(ptr);
|
||||
if (!ctx->DataAvailable(ptr)) break;
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
|
||||
} else
|
||||
goto handle_unusual;
|
||||
continue;
|
||||
default:
|
||||
goto handle_unusual;
|
||||
} // switch
|
||||
@@ -3676,6 +3745,36 @@ uint8_t* CreateDatabaseExpr::_InternalSerialize(
|
||||
target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_create_if_not_exists(), target);
|
||||
}
|
||||
|
||||
// map<string, string> options = 3;
|
||||
if (!this->_internal_options().empty()) {
|
||||
using MapType = ::_pb::Map<std::string, std::string>;
|
||||
using WireHelper = CreateDatabaseExpr_OptionsEntry_DoNotUse::Funcs;
|
||||
const auto& map_field = this->_internal_options();
|
||||
auto check_utf8 = [](const MapType::value_type& entry) {
|
||||
(void)entry;
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
entry.first.data(), static_cast<int>(entry.first.length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
|
||||
"greptime.v1.CreateDatabaseExpr.OptionsEntry.key");
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
entry.second.data(), static_cast<int>(entry.second.length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
|
||||
"greptime.v1.CreateDatabaseExpr.OptionsEntry.value");
|
||||
};
|
||||
|
||||
if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
|
||||
for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
|
||||
target = WireHelper::InternalSerialize(3, entry.first, entry.second, target, stream);
|
||||
check_utf8(entry);
|
||||
}
|
||||
} else {
|
||||
for (const auto& entry : map_field) {
|
||||
target = WireHelper::InternalSerialize(3, entry.first, entry.second, target, stream);
|
||||
check_utf8(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
|
||||
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
||||
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
|
||||
@@ -3692,6 +3791,15 @@ size_t CreateDatabaseExpr::ByteSizeLong() const {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
// map<string, string> options = 3;
|
||||
total_size += 1 *
|
||||
::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_options_size());
|
||||
for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
|
||||
it = this->_internal_options().begin();
|
||||
it != this->_internal_options().end(); ++it) {
|
||||
total_size += CreateDatabaseExpr_OptionsEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
|
||||
}
|
||||
|
||||
// string database_name = 1;
|
||||
if (!this->_internal_database_name().empty()) {
|
||||
total_size += 1 +
|
||||
@@ -3722,6 +3830,7 @@ void CreateDatabaseExpr::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, con
|
||||
uint32_t cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
_this->_impl_.options_.MergeFrom(from._impl_.options_);
|
||||
if (!from._internal_database_name().empty()) {
|
||||
_this->_internal_set_database_name(from._internal_database_name());
|
||||
}
|
||||
@@ -3747,6 +3856,7 @@ void CreateDatabaseExpr::InternalSwap(CreateDatabaseExpr* other) {
|
||||
auto* lhs_arena = GetArenaForAllocation();
|
||||
auto* rhs_arena = other->GetArenaForAllocation();
|
||||
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
|
||||
_impl_.options_.InternalSwap(&other->_impl_.options_);
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
|
||||
&_impl_.database_name_, lhs_arena,
|
||||
&other->_impl_.database_name_, rhs_arena
|
||||
@@ -3757,7 +3867,7 @@ void CreateDatabaseExpr::InternalSwap(CreateDatabaseExpr* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata CreateDatabaseExpr::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[7]);
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[8]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -4102,7 +4212,7 @@ void TruncateTableExpr::InternalSwap(TruncateTableExpr* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata TruncateTableExpr::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[8]);
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[9]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -4287,7 +4397,7 @@ void AddColumns::InternalSwap(AddColumns* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata AddColumns::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[9]);
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[10]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -4472,7 +4582,7 @@ void DropColumns::InternalSwap(DropColumns* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata DropColumns::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[10]);
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[11]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -4675,7 +4785,7 @@ void RenameTable::InternalSwap(RenameTable* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata RenameTable::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[11]);
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[12]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -4908,7 +5018,7 @@ void AddColumn_Location::InternalSwap(AddColumn_Location* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata AddColumn_Location::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[12]);
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[13]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -5179,7 +5289,7 @@ void AddColumn::InternalSwap(AddColumn* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata AddColumn::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[13]);
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[14]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -5382,7 +5492,7 @@ void DropColumn::InternalSwap(DropColumn* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata DropColumn::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[14]);
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[15]);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
@@ -5560,7 +5670,7 @@ void TableId::InternalSwap(TableId* other) {
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata TableId::GetMetadata() const {
|
||||
return ::_pbi::AssignDescriptors(
|
||||
&descriptor_table_greptime_2fv1_2fddl_2eproto_getter, &descriptor_table_greptime_2fv1_2fddl_2eproto_once,
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[15]);
|
||||
file_level_metadata_greptime_2fv1_2fddl_2eproto[16]);
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
@@ -5595,6 +5705,10 @@ template<> PROTOBUF_NOINLINE ::greptime::v1::CompactTableExpr*
|
||||
Arena::CreateMaybeMessage< ::greptime::v1::CompactTableExpr >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::greptime::v1::CompactTableExpr >(arena);
|
||||
}
|
||||
template<> PROTOBUF_NOINLINE ::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse*
|
||||
Arena::CreateMaybeMessage< ::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse >(arena);
|
||||
}
|
||||
template<> PROTOBUF_NOINLINE ::greptime::v1::CreateDatabaseExpr*
|
||||
Arena::CreateMaybeMessage< ::greptime::v1::CreateDatabaseExpr >(Arena* arena) {
|
||||
return Arena::CreateMessageInternal< ::greptime::v1::CreateDatabaseExpr >(arena);
|
||||
|
||||
+100
-9
@@ -69,6 +69,9 @@ extern CompactTableExprDefaultTypeInternal _CompactTableExpr_default_instance_;
|
||||
class CreateDatabaseExpr;
|
||||
struct CreateDatabaseExprDefaultTypeInternal;
|
||||
extern CreateDatabaseExprDefaultTypeInternal _CreateDatabaseExpr_default_instance_;
|
||||
class CreateDatabaseExpr_OptionsEntry_DoNotUse;
|
||||
struct CreateDatabaseExpr_OptionsEntry_DoNotUseDefaultTypeInternal;
|
||||
extern CreateDatabaseExpr_OptionsEntry_DoNotUseDefaultTypeInternal _CreateDatabaseExpr_OptionsEntry_DoNotUse_default_instance_;
|
||||
class CreateTableExpr;
|
||||
struct CreateTableExprDefaultTypeInternal;
|
||||
extern CreateTableExprDefaultTypeInternal _CreateTableExpr_default_instance_;
|
||||
@@ -108,6 +111,7 @@ template<> ::greptime::v1::AddColumns* Arena::CreateMaybeMessage<::greptime::v1:
|
||||
template<> ::greptime::v1::AlterExpr* Arena::CreateMaybeMessage<::greptime::v1::AlterExpr>(Arena*);
|
||||
template<> ::greptime::v1::CompactTableExpr* Arena::CreateMaybeMessage<::greptime::v1::CompactTableExpr>(Arena*);
|
||||
template<> ::greptime::v1::CreateDatabaseExpr* Arena::CreateMaybeMessage<::greptime::v1::CreateDatabaseExpr>(Arena*);
|
||||
template<> ::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse* Arena::CreateMaybeMessage<::greptime::v1::CreateDatabaseExpr_OptionsEntry_DoNotUse>(Arena*);
|
||||
template<> ::greptime::v1::CreateTableExpr* Arena::CreateMaybeMessage<::greptime::v1::CreateTableExpr>(Arena*);
|
||||
template<> ::greptime::v1::CreateTableExpr_TableOptionsEntry_DoNotUse* Arena::CreateMaybeMessage<::greptime::v1::CreateTableExpr_TableOptionsEntry_DoNotUse>(Arena*);
|
||||
template<> ::greptime::v1::DdlRequest* Arena::CreateMaybeMessage<::greptime::v1::DdlRequest>(Arena*);
|
||||
@@ -1758,6 +1762,34 @@ class CompactTableExpr final :
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class CreateDatabaseExpr_OptionsEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<CreateDatabaseExpr_OptionsEntry_DoNotUse,
|
||||
std::string, std::string,
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> {
|
||||
public:
|
||||
typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<CreateDatabaseExpr_OptionsEntry_DoNotUse,
|
||||
std::string, std::string,
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> SuperType;
|
||||
CreateDatabaseExpr_OptionsEntry_DoNotUse();
|
||||
explicit PROTOBUF_CONSTEXPR CreateDatabaseExpr_OptionsEntry_DoNotUse(
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
|
||||
explicit CreateDatabaseExpr_OptionsEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena);
|
||||
void MergeFrom(const CreateDatabaseExpr_OptionsEntry_DoNotUse& other);
|
||||
static const CreateDatabaseExpr_OptionsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast<const CreateDatabaseExpr_OptionsEntry_DoNotUse*>(&_CreateDatabaseExpr_OptionsEntry_DoNotUse_default_instance_); }
|
||||
static bool ValidateKey(std::string* s) {
|
||||
return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast<int>(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "greptime.v1.CreateDatabaseExpr.OptionsEntry.key");
|
||||
}
|
||||
static bool ValidateValue(std::string* s) {
|
||||
return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast<int>(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "greptime.v1.CreateDatabaseExpr.OptionsEntry.value");
|
||||
}
|
||||
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
|
||||
friend struct ::TableStruct_greptime_2fv1_2fddl_2eproto;
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class CreateDatabaseExpr final :
|
||||
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.CreateDatabaseExpr) */ {
|
||||
public:
|
||||
@@ -1806,7 +1838,7 @@ class CreateDatabaseExpr final :
|
||||
&_CreateDatabaseExpr_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
7;
|
||||
8;
|
||||
|
||||
friend void swap(CreateDatabaseExpr& a, CreateDatabaseExpr& b) {
|
||||
a.Swap(&b);
|
||||
@@ -1867,6 +1899,8 @@ class CreateDatabaseExpr final :
|
||||
protected:
|
||||
explicit CreateDatabaseExpr(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
||||
bool is_message_owned = false);
|
||||
private:
|
||||
static void ArenaDtor(void* object);
|
||||
public:
|
||||
|
||||
static const ClassData _class_data_;
|
||||
@@ -1876,12 +1910,31 @@ class CreateDatabaseExpr final :
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
enum : int {
|
||||
kOptionsFieldNumber = 3,
|
||||
kDatabaseNameFieldNumber = 1,
|
||||
kCreateIfNotExistsFieldNumber = 2,
|
||||
};
|
||||
// map<string, string> options = 3;
|
||||
int options_size() const;
|
||||
private:
|
||||
int _internal_options_size() const;
|
||||
public:
|
||||
void clear_options();
|
||||
private:
|
||||
const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >&
|
||||
_internal_options() const;
|
||||
::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >*
|
||||
_internal_mutable_options();
|
||||
public:
|
||||
const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >&
|
||||
options() const;
|
||||
::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >*
|
||||
mutable_options();
|
||||
|
||||
// string database_name = 1;
|
||||
void clear_database_name();
|
||||
const std::string& database_name() const;
|
||||
@@ -1913,6 +1966,11 @@ class CreateDatabaseExpr final :
|
||||
typedef void InternalArenaConstructable_;
|
||||
typedef void DestructorSkippable_;
|
||||
struct Impl_ {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::MapField<
|
||||
CreateDatabaseExpr_OptionsEntry_DoNotUse,
|
||||
std::string, std::string,
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> options_;
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr database_name_;
|
||||
bool create_if_not_exists_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
@@ -1970,7 +2028,7 @@ class TruncateTableExpr final :
|
||||
&_TruncateTableExpr_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
8;
|
||||
9;
|
||||
|
||||
friend void swap(TruncateTableExpr& a, TruncateTableExpr& b) {
|
||||
a.Swap(&b);
|
||||
@@ -2175,7 +2233,7 @@ class AddColumns final :
|
||||
&_AddColumns_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
9;
|
||||
10;
|
||||
|
||||
friend void swap(AddColumns& a, AddColumns& b) {
|
||||
a.Swap(&b);
|
||||
@@ -2332,7 +2390,7 @@ class DropColumns final :
|
||||
&_DropColumns_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
10;
|
||||
11;
|
||||
|
||||
friend void swap(DropColumns& a, DropColumns& b) {
|
||||
a.Swap(&b);
|
||||
@@ -2489,7 +2547,7 @@ class RenameTable final :
|
||||
&_RenameTable_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
11;
|
||||
12;
|
||||
|
||||
friend void swap(RenameTable& a, RenameTable& b) {
|
||||
a.Swap(&b);
|
||||
@@ -2642,7 +2700,7 @@ class AddColumn_Location final :
|
||||
&_AddColumn_Location_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
12;
|
||||
13;
|
||||
|
||||
friend void swap(AddColumn_Location& a, AddColumn_Location& b) {
|
||||
a.Swap(&b);
|
||||
@@ -2836,7 +2894,7 @@ class AddColumn final :
|
||||
&_AddColumn_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
13;
|
||||
14;
|
||||
|
||||
friend void swap(AddColumn& a, AddColumn& b) {
|
||||
a.Swap(&b);
|
||||
@@ -3026,7 +3084,7 @@ class DropColumn final :
|
||||
&_DropColumn_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
14;
|
||||
15;
|
||||
|
||||
friend void swap(DropColumn& a, DropColumn& b) {
|
||||
a.Swap(&b);
|
||||
@@ -3179,7 +3237,7 @@ class TableId final :
|
||||
&_TableId_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages =
|
||||
15;
|
||||
16;
|
||||
|
||||
friend void swap(TableId& a, TableId& b) {
|
||||
a.Swap(&b);
|
||||
@@ -5598,6 +5656,8 @@ inline void CompactTableExpr::set_region_number(uint32_t value) {
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// CreateDatabaseExpr
|
||||
|
||||
// string database_name = 1;
|
||||
@@ -5670,6 +5730,35 @@ inline void CreateDatabaseExpr::set_create_if_not_exists(bool value) {
|
||||
// @@protoc_insertion_point(field_set:greptime.v1.CreateDatabaseExpr.create_if_not_exists)
|
||||
}
|
||||
|
||||
// map<string, string> options = 3;
|
||||
inline int CreateDatabaseExpr::_internal_options_size() const {
|
||||
return _impl_.options_.size();
|
||||
}
|
||||
inline int CreateDatabaseExpr::options_size() const {
|
||||
return _internal_options_size();
|
||||
}
|
||||
inline void CreateDatabaseExpr::clear_options() {
|
||||
_impl_.options_.Clear();
|
||||
}
|
||||
inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >&
|
||||
CreateDatabaseExpr::_internal_options() const {
|
||||
return _impl_.options_.GetMap();
|
||||
}
|
||||
inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >&
|
||||
CreateDatabaseExpr::options() const {
|
||||
// @@protoc_insertion_point(field_map:greptime.v1.CreateDatabaseExpr.options)
|
||||
return _internal_options();
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >*
|
||||
CreateDatabaseExpr::_internal_mutable_options() {
|
||||
return _impl_.options_.MutableMap();
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >*
|
||||
CreateDatabaseExpr::mutable_options() {
|
||||
// @@protoc_insertion_point(field_mutable_map:greptime.v1.CreateDatabaseExpr.options)
|
||||
return _internal_mutable_options();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// TruncateTableExpr
|
||||
@@ -6440,6 +6529,8 @@ inline void TableId::set_id(uint32_t value) {
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user