feat: support trigger drop (#248)

* feat: add trigger-drop proto

* remove trigger id of DropTriggerExpr
This commit is contained in:
fys
2025-06-25 02:06:43 +08:00
committed by GitHub
parent 819a949550
commit 464226cf8a
10 changed files with 3421 additions and 307 deletions
+310
View File
@@ -123,6 +123,9 @@ extern DropFlowExprDefaultTypeInternal _DropFlowExpr_default_instance_;
class DropTableExpr;
struct DropTableExprDefaultTypeInternal;
extern DropTableExprDefaultTypeInternal _DropTableExpr_default_instance_;
class DropTriggerExpr;
struct DropTriggerExprDefaultTypeInternal;
extern DropTriggerExprDefaultTypeInternal _DropTriggerExpr_default_instance_;
class DropViewExpr;
struct DropViewExprDefaultTypeInternal;
extern DropViewExprDefaultTypeInternal _DropViewExpr_default_instance_;
@@ -219,6 +222,7 @@ template<> ::greptime::v1::DropDefault* Arena::CreateMaybeMessage<::greptime::v1
template<> ::greptime::v1::DropDefaults* Arena::CreateMaybeMessage<::greptime::v1::DropDefaults>(Arena*);
template<> ::greptime::v1::DropFlowExpr* Arena::CreateMaybeMessage<::greptime::v1::DropFlowExpr>(Arena*);
template<> ::greptime::v1::DropTableExpr* Arena::CreateMaybeMessage<::greptime::v1::DropTableExpr>(Arena*);
template<> ::greptime::v1::DropTriggerExpr* Arena::CreateMaybeMessage<::greptime::v1::DropTriggerExpr>(Arena*);
template<> ::greptime::v1::DropViewExpr* Arena::CreateMaybeMessage<::greptime::v1::DropViewExpr>(Arena*);
template<> ::greptime::v1::FlowId* Arena::CreateMaybeMessage<::greptime::v1::FlowId>(Arena*);
template<> ::greptime::v1::ModifyColumnType* Arena::CreateMaybeMessage<::greptime::v1::ModifyColumnType>(Arena*);
@@ -8782,6 +8786,186 @@ class WebhookOptions final :
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2fddl_2eproto;
};
// -------------------------------------------------------------------
class DropTriggerExpr final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.DropTriggerExpr) */ {
public:
inline DropTriggerExpr() : DropTriggerExpr(nullptr) {}
~DropTriggerExpr() override;
explicit PROTOBUF_CONSTEXPR DropTriggerExpr(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
DropTriggerExpr(const DropTriggerExpr& from);
DropTriggerExpr(DropTriggerExpr&& from) noexcept
: DropTriggerExpr() {
*this = ::std::move(from);
}
inline DropTriggerExpr& operator=(const DropTriggerExpr& from) {
CopyFrom(from);
return *this;
}
inline DropTriggerExpr& operator=(DropTriggerExpr&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const DropTriggerExpr& default_instance() {
return *internal_default_instance();
}
static inline const DropTriggerExpr* internal_default_instance() {
return reinterpret_cast<const DropTriggerExpr*>(
&_DropTriggerExpr_default_instance_);
}
static constexpr int kIndexInFileMessages =
47;
friend void swap(DropTriggerExpr& a, DropTriggerExpr& b) {
a.Swap(&b);
}
inline void Swap(DropTriggerExpr* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(DropTriggerExpr* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
DropTriggerExpr* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<DropTriggerExpr>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
void CopyFrom(const DropTriggerExpr& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
void MergeFrom( const DropTriggerExpr& from) {
DropTriggerExpr::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(DropTriggerExpr* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "greptime.v1.DropTriggerExpr";
}
protected:
explicit DropTriggerExpr(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kCatalogNameFieldNumber = 1,
kTriggerNameFieldNumber = 2,
kDropIfExistsFieldNumber = 3,
};
// string catalog_name = 1;
void clear_catalog_name();
const std::string& catalog_name() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_catalog_name(ArgT0&& arg0, ArgT... args);
std::string* mutable_catalog_name();
PROTOBUF_NODISCARD std::string* release_catalog_name();
void set_allocated_catalog_name(std::string* catalog_name);
private:
const std::string& _internal_catalog_name() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_catalog_name(const std::string& value);
std::string* _internal_mutable_catalog_name();
public:
// string trigger_name = 2;
void clear_trigger_name();
const std::string& trigger_name() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_trigger_name(ArgT0&& arg0, ArgT... args);
std::string* mutable_trigger_name();
PROTOBUF_NODISCARD std::string* release_trigger_name();
void set_allocated_trigger_name(std::string* trigger_name);
private:
const std::string& _internal_trigger_name() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_trigger_name(const std::string& value);
std::string* _internal_mutable_trigger_name();
public:
// bool drop_if_exists = 3;
void clear_drop_if_exists();
bool drop_if_exists() const;
void set_drop_if_exists(bool value);
private:
bool _internal_drop_if_exists() const;
void _internal_set_drop_if_exists(bool value);
public:
// @@protoc_insertion_point(class_scope:greptime.v1.DropTriggerExpr)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr catalog_name_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr trigger_name_;
bool drop_if_exists_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2fddl_2eproto;
};
// ===================================================================
@@ -16429,6 +16613,130 @@ WebhookOptions::mutable_opts() {
return _internal_mutable_opts();
}
// -------------------------------------------------------------------
// DropTriggerExpr
// string catalog_name = 1;
inline void DropTriggerExpr::clear_catalog_name() {
_impl_.catalog_name_.ClearToEmpty();
}
inline const std::string& DropTriggerExpr::catalog_name() const {
// @@protoc_insertion_point(field_get:greptime.v1.DropTriggerExpr.catalog_name)
return _internal_catalog_name();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void DropTriggerExpr::set_catalog_name(ArgT0&& arg0, ArgT... args) {
_impl_.catalog_name_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:greptime.v1.DropTriggerExpr.catalog_name)
}
inline std::string* DropTriggerExpr::mutable_catalog_name() {
std::string* _s = _internal_mutable_catalog_name();
// @@protoc_insertion_point(field_mutable:greptime.v1.DropTriggerExpr.catalog_name)
return _s;
}
inline const std::string& DropTriggerExpr::_internal_catalog_name() const {
return _impl_.catalog_name_.Get();
}
inline void DropTriggerExpr::_internal_set_catalog_name(const std::string& value) {
_impl_.catalog_name_.Set(value, GetArenaForAllocation());
}
inline std::string* DropTriggerExpr::_internal_mutable_catalog_name() {
return _impl_.catalog_name_.Mutable(GetArenaForAllocation());
}
inline std::string* DropTriggerExpr::release_catalog_name() {
// @@protoc_insertion_point(field_release:greptime.v1.DropTriggerExpr.catalog_name)
return _impl_.catalog_name_.Release();
}
inline void DropTriggerExpr::set_allocated_catalog_name(std::string* catalog_name) {
if (catalog_name != nullptr) {
} else {
}
_impl_.catalog_name_.SetAllocated(catalog_name, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.catalog_name_.IsDefault()) {
_impl_.catalog_name_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:greptime.v1.DropTriggerExpr.catalog_name)
}
// string trigger_name = 2;
inline void DropTriggerExpr::clear_trigger_name() {
_impl_.trigger_name_.ClearToEmpty();
}
inline const std::string& DropTriggerExpr::trigger_name() const {
// @@protoc_insertion_point(field_get:greptime.v1.DropTriggerExpr.trigger_name)
return _internal_trigger_name();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void DropTriggerExpr::set_trigger_name(ArgT0&& arg0, ArgT... args) {
_impl_.trigger_name_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:greptime.v1.DropTriggerExpr.trigger_name)
}
inline std::string* DropTriggerExpr::mutable_trigger_name() {
std::string* _s = _internal_mutable_trigger_name();
// @@protoc_insertion_point(field_mutable:greptime.v1.DropTriggerExpr.trigger_name)
return _s;
}
inline const std::string& DropTriggerExpr::_internal_trigger_name() const {
return _impl_.trigger_name_.Get();
}
inline void DropTriggerExpr::_internal_set_trigger_name(const std::string& value) {
_impl_.trigger_name_.Set(value, GetArenaForAllocation());
}
inline std::string* DropTriggerExpr::_internal_mutable_trigger_name() {
return _impl_.trigger_name_.Mutable(GetArenaForAllocation());
}
inline std::string* DropTriggerExpr::release_trigger_name() {
// @@protoc_insertion_point(field_release:greptime.v1.DropTriggerExpr.trigger_name)
return _impl_.trigger_name_.Release();
}
inline void DropTriggerExpr::set_allocated_trigger_name(std::string* trigger_name) {
if (trigger_name != nullptr) {
} else {
}
_impl_.trigger_name_.SetAllocated(trigger_name, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.trigger_name_.IsDefault()) {
_impl_.trigger_name_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:greptime.v1.DropTriggerExpr.trigger_name)
}
// bool drop_if_exists = 3;
inline void DropTriggerExpr::clear_drop_if_exists() {
_impl_.drop_if_exists_ = false;
}
inline bool DropTriggerExpr::_internal_drop_if_exists() const {
return _impl_.drop_if_exists_;
}
inline bool DropTriggerExpr::drop_if_exists() const {
// @@protoc_insertion_point(field_get:greptime.v1.DropTriggerExpr.drop_if_exists)
return _internal_drop_if_exists();
}
inline void DropTriggerExpr::_internal_set_drop_if_exists(bool value) {
_impl_.drop_if_exists_ = value;
}
inline void DropTriggerExpr::set_drop_if_exists(bool value) {
_internal_set_drop_if_exists(value);
// @@protoc_insertion_point(field_set:greptime.v1.DropTriggerExpr.drop_if_exists)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
@@ -16524,6 +16832,8 @@ WebhookOptions::mutable_opts() {
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)