1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Charset {
5 #[prost(int32, tag = "1")]
7 pub client: i32,
8 #[prost(int32, tag = "2")]
10 pub conn: i32,
11 #[prost(int32, tag = "3")]
13 pub server: i32,
14}
15#[allow(clippy::derive_partial_eq_without_eq)]
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct BinlogTransaction {
20 #[prost(message, repeated, tag = "1")]
22 pub statements: ::prost::alloc::vec::Vec<binlog_transaction::Statement>,
23 #[prost(message, optional, tag = "4")]
25 pub event_token: ::core::option::Option<super::query::EventToken>,
26}
27pub mod binlog_transaction {
29 #[allow(clippy::derive_partial_eq_without_eq)]
30 #[derive(Clone, PartialEq, ::prost::Message)]
31 pub struct Statement {
32 #[prost(enumeration = "statement::Category", tag = "1")]
34 pub category: i32,
35 #[prost(message, optional, tag = "2")]
37 pub charset: ::core::option::Option<super::Charset>,
38 #[prost(bytes = "vec", tag = "3")]
40 pub sql: ::prost::alloc::vec::Vec<u8>,
41 }
42 pub mod statement {
44 #[derive(
45 Clone,
46 Copy,
47 Debug,
48 PartialEq,
49 Eq,
50 Hash,
51 PartialOrd,
52 Ord,
53 ::prost::Enumeration
54 )]
55 #[repr(i32)]
56 pub enum Category {
57 BlUnrecognized = 0,
58 BlBegin = 1,
59 BlCommit = 2,
60 BlRollback = 3,
61 BlDmlDeprecated = 4,
63 BlDdl = 5,
64 BlSet = 6,
65 BlInsert = 7,
66 BlUpdate = 8,
67 BlDelete = 9,
68 }
69 impl Category {
70 pub fn as_str_name(&self) -> &'static str {
75 match self {
76 Category::BlUnrecognized => "BL_UNRECOGNIZED",
77 Category::BlBegin => "BL_BEGIN",
78 Category::BlCommit => "BL_COMMIT",
79 Category::BlRollback => "BL_ROLLBACK",
80 Category::BlDmlDeprecated => "BL_DML_DEPRECATED",
81 Category::BlDdl => "BL_DDL",
82 Category::BlSet => "BL_SET",
83 Category::BlInsert => "BL_INSERT",
84 Category::BlUpdate => "BL_UPDATE",
85 Category::BlDelete => "BL_DELETE",
86 }
87 }
88 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
90 match value {
91 "BL_UNRECOGNIZED" => Some(Self::BlUnrecognized),
92 "BL_BEGIN" => Some(Self::BlBegin),
93 "BL_COMMIT" => Some(Self::BlCommit),
94 "BL_ROLLBACK" => Some(Self::BlRollback),
95 "BL_DML_DEPRECATED" => Some(Self::BlDmlDeprecated),
96 "BL_DDL" => Some(Self::BlDdl),
97 "BL_SET" => Some(Self::BlSet),
98 "BL_INSERT" => Some(Self::BlInsert),
99 "BL_UPDATE" => Some(Self::BlUpdate),
100 "BL_DELETE" => Some(Self::BlDelete),
101 _ => None,
102 }
103 }
104 }
105 }
106}
107#[allow(clippy::derive_partial_eq_without_eq)]
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct StreamKeyRangeRequest {
111 #[prost(string, tag = "1")]
113 pub position: ::prost::alloc::string::String,
114 #[prost(message, optional, tag = "2")]
116 pub key_range: ::core::option::Option<super::topodata::KeyRange>,
117 #[prost(message, optional, tag = "3")]
119 pub charset: ::core::option::Option<Charset>,
120}
121#[allow(clippy::derive_partial_eq_without_eq)]
123#[derive(Clone, PartialEq, ::prost::Message)]
124pub struct StreamKeyRangeResponse {
125 #[prost(message, optional, tag = "1")]
126 pub binlog_transaction: ::core::option::Option<BinlogTransaction>,
127}
128#[allow(clippy::derive_partial_eq_without_eq)]
130#[derive(Clone, PartialEq, ::prost::Message)]
131pub struct StreamTablesRequest {
132 #[prost(string, tag = "1")]
134 pub position: ::prost::alloc::string::String,
135 #[prost(string, repeated, tag = "2")]
137 pub tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
138 #[prost(message, optional, tag = "3")]
140 pub charset: ::core::option::Option<Charset>,
141}
142#[allow(clippy::derive_partial_eq_without_eq)]
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct StreamTablesResponse {
146 #[prost(message, optional, tag = "1")]
147 pub binlog_transaction: ::core::option::Option<BinlogTransaction>,
148}
149#[allow(clippy::derive_partial_eq_without_eq)]
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct CharsetConversion {
153 #[prost(string, tag = "1")]
155 pub from_charset: ::prost::alloc::string::String,
156 #[prost(string, tag = "2")]
158 pub to_charset: ::prost::alloc::string::String,
159}
160#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct Rule {
164 #[prost(string, tag = "1")]
169 pub r#match: ::prost::alloc::string::String,
170 #[prost(string, tag = "2")]
191 pub filter: ::prost::alloc::string::String,
192 #[prost(map = "string, string", tag = "3")]
194 pub convert_enum_to_text: ::std::collections::HashMap<
195 ::prost::alloc::string::String,
196 ::prost::alloc::string::String,
197 >,
198 #[prost(map = "string, message", tag = "4")]
203 pub convert_charset: ::std::collections::HashMap<
204 ::prost::alloc::string::String,
205 CharsetConversion,
206 >,
207 #[prost(string, tag = "5")]
210 pub source_unique_key_columns: ::prost::alloc::string::String,
211 #[prost(string, tag = "6")]
214 pub target_unique_key_columns: ::prost::alloc::string::String,
215 #[prost(string, tag = "7")]
218 pub source_unique_key_target_columns: ::prost::alloc::string::String,
219 #[prost(map = "string, bool", tag = "8")]
223 pub convert_int_to_enum: ::std::collections::HashMap<
224 ::prost::alloc::string::String,
225 bool,
226 >,
227}
228#[allow(clippy::derive_partial_eq_without_eq)]
231#[derive(Clone, PartialEq, ::prost::Message)]
232pub struct Filter {
233 #[prost(message, repeated, tag = "1")]
234 pub rules: ::prost::alloc::vec::Vec<Rule>,
235 #[prost(enumeration = "filter::FieldEventMode", tag = "2")]
244 pub field_event_mode: i32,
245 #[prost(int64, tag = "3")]
246 pub workflow_type: i64,
247 #[prost(string, tag = "4")]
248 pub workflow_name: ::prost::alloc::string::String,
249}
250pub mod filter {
252 #[derive(
253 Clone,
254 Copy,
255 Debug,
256 PartialEq,
257 Eq,
258 Hash,
259 PartialOrd,
260 Ord,
261 ::prost::Enumeration
262 )]
263 #[repr(i32)]
264 pub enum FieldEventMode {
265 ErrOnMismatch = 0,
266 BestEffort = 1,
267 }
268 impl FieldEventMode {
269 pub fn as_str_name(&self) -> &'static str {
274 match self {
275 FieldEventMode::ErrOnMismatch => "ERR_ON_MISMATCH",
276 FieldEventMode::BestEffort => "BEST_EFFORT",
277 }
278 }
279 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
281 match value {
282 "ERR_ON_MISMATCH" => Some(Self::ErrOnMismatch),
283 "BEST_EFFORT" => Some(Self::BestEffort),
284 _ => None,
285 }
286 }
287 }
288}
289#[allow(clippy::derive_partial_eq_without_eq)]
293#[derive(Clone, PartialEq, ::prost::Message)]
294pub struct BinlogSource {
295 #[prost(string, tag = "1")]
297 pub keyspace: ::prost::alloc::string::String,
298 #[prost(string, tag = "2")]
300 pub shard: ::prost::alloc::string::String,
301 #[prost(enumeration = "super::topodata::TabletType", tag = "3")]
303 pub tablet_type: i32,
304 #[prost(message, optional, tag = "4")]
306 pub key_range: ::core::option::Option<super::topodata::KeyRange>,
307 #[prost(string, repeated, tag = "5")]
309 pub tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
310 #[prost(message, optional, tag = "6")]
313 pub filter: ::core::option::Option<Filter>,
314 #[prost(enumeration = "OnDdlAction", tag = "7")]
316 pub on_ddl: i32,
317 #[prost(string, tag = "8")]
320 pub external_mysql: ::prost::alloc::string::String,
321 #[prost(bool, tag = "9")]
324 pub stop_after_copy: bool,
325 #[prost(string, tag = "10")]
328 pub external_cluster: ::prost::alloc::string::String,
329 #[prost(string, tag = "11")]
331 pub source_time_zone: ::prost::alloc::string::String,
332 #[prost(string, tag = "12")]
335 pub target_time_zone: ::prost::alloc::string::String,
336}
337#[allow(clippy::derive_partial_eq_without_eq)]
342#[derive(Clone, PartialEq, ::prost::Message)]
343pub struct RowChange {
344 #[prost(message, optional, tag = "1")]
345 pub before: ::core::option::Option<super::query::Row>,
346 #[prost(message, optional, tag = "2")]
347 pub after: ::core::option::Option<super::query::Row>,
348 #[prost(message, optional, tag = "3")]
350 pub data_columns: ::core::option::Option<row_change::Bitmap>,
351}
352pub mod row_change {
354 #[allow(clippy::derive_partial_eq_without_eq)]
355 #[derive(Clone, PartialEq, ::prost::Message)]
356 pub struct Bitmap {
357 #[prost(int64, tag = "1")]
358 pub count: i64,
359 #[prost(bytes = "vec", tag = "2")]
360 pub cols: ::prost::alloc::vec::Vec<u8>,
361 }
362}
363#[allow(clippy::derive_partial_eq_without_eq)]
365#[derive(Clone, PartialEq, ::prost::Message)]
366pub struct RowEvent {
367 #[prost(string, tag = "1")]
368 pub table_name: ::prost::alloc::string::String,
369 #[prost(message, repeated, tag = "2")]
370 pub row_changes: ::prost::alloc::vec::Vec<RowChange>,
371 #[prost(string, tag = "3")]
372 pub keyspace: ::prost::alloc::string::String,
373 #[prost(string, tag = "4")]
374 pub shard: ::prost::alloc::string::String,
375 #[prost(uint32, tag = "5")]
377 pub flags: u32,
378}
379#[allow(clippy::derive_partial_eq_without_eq)]
381#[derive(Clone, PartialEq, ::prost::Message)]
382pub struct FieldEvent {
383 #[prost(string, tag = "1")]
384 pub table_name: ::prost::alloc::string::String,
385 #[prost(message, repeated, tag = "2")]
386 pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
387 #[prost(string, tag = "3")]
388 pub keyspace: ::prost::alloc::string::String,
389 #[prost(string, tag = "4")]
390 pub shard: ::prost::alloc::string::String,
391}
392#[allow(clippy::derive_partial_eq_without_eq)]
398#[derive(Clone, PartialEq, ::prost::Message)]
399pub struct ShardGtid {
400 #[prost(string, tag = "1")]
401 pub keyspace: ::prost::alloc::string::String,
402 #[prost(string, tag = "2")]
403 pub shard: ::prost::alloc::string::String,
404 #[prost(string, tag = "3")]
405 pub gtid: ::prost::alloc::string::String,
406 #[prost(message, repeated, tag = "4")]
407 pub table_p_ks: ::prost::alloc::vec::Vec<TableLastPk>,
408}
409#[allow(clippy::derive_partial_eq_without_eq)]
411#[derive(Clone, PartialEq, ::prost::Message)]
412pub struct VGtid {
413 #[prost(message, repeated, tag = "1")]
414 pub shard_gtids: ::prost::alloc::vec::Vec<ShardGtid>,
415}
416#[allow(clippy::derive_partial_eq_without_eq)]
418#[derive(Clone, PartialEq, ::prost::Message)]
419pub struct KeyspaceShard {
420 #[prost(string, tag = "1")]
421 pub keyspace: ::prost::alloc::string::String,
422 #[prost(string, tag = "2")]
423 pub shard: ::prost::alloc::string::String,
424}
425#[allow(clippy::derive_partial_eq_without_eq)]
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct Journal {
431 #[prost(int64, tag = "1")]
433 pub id: i64,
434 #[prost(enumeration = "MigrationType", tag = "2")]
435 pub migration_type: i32,
436 #[prost(string, repeated, tag = "3")]
438 pub tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
439 #[prost(string, tag = "4")]
441 pub local_position: ::prost::alloc::string::String,
442 #[prost(message, repeated, tag = "5")]
444 pub shard_gtids: ::prost::alloc::vec::Vec<ShardGtid>,
445 #[prost(message, repeated, tag = "6")]
453 pub participants: ::prost::alloc::vec::Vec<KeyspaceShard>,
454 #[prost(string, repeated, tag = "7")]
459 pub source_workflows: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
460}
461#[allow(clippy::derive_partial_eq_without_eq)]
470#[derive(Clone, PartialEq, ::prost::Message)]
471pub struct VEvent {
472 #[prost(enumeration = "VEventType", tag = "1")]
473 pub r#type: i32,
474 #[prost(int64, tag = "2")]
477 pub timestamp: i64,
478 #[prost(string, tag = "3")]
480 pub gtid: ::prost::alloc::string::String,
481 #[prost(string, tag = "4")]
483 pub statement: ::prost::alloc::string::String,
484 #[prost(message, optional, tag = "5")]
486 pub row_event: ::core::option::Option<RowEvent>,
487 #[prost(message, optional, tag = "6")]
489 pub field_event: ::core::option::Option<FieldEvent>,
490 #[prost(message, optional, tag = "7")]
493 pub vgtid: ::core::option::Option<VGtid>,
494 #[prost(message, optional, tag = "8")]
496 pub journal: ::core::option::Option<Journal>,
497 #[prost(string, tag = "9")]
499 pub dml: ::prost::alloc::string::String,
500 #[prost(int64, tag = "20")]
503 pub current_time: i64,
504 #[prost(message, optional, tag = "21")]
506 pub last_p_k_event: ::core::option::Option<LastPkEvent>,
507 #[prost(string, tag = "22")]
509 pub keyspace: ::prost::alloc::string::String,
510 #[prost(string, tag = "23")]
512 pub shard: ::prost::alloc::string::String,
513 #[prost(bool, tag = "24")]
515 pub throttled: bool,
516}
517#[allow(clippy::derive_partial_eq_without_eq)]
518#[derive(Clone, PartialEq, ::prost::Message)]
519pub struct MinimalTable {
520 #[prost(string, tag = "1")]
521 pub name: ::prost::alloc::string::String,
522 #[prost(message, repeated, tag = "2")]
523 pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
524 #[prost(int64, repeated, tag = "3")]
525 pub p_k_columns: ::prost::alloc::vec::Vec<i64>,
526}
527#[allow(clippy::derive_partial_eq_without_eq)]
528#[derive(Clone, PartialEq, ::prost::Message)]
529pub struct MinimalSchema {
530 #[prost(message, repeated, tag = "1")]
531 pub tables: ::prost::alloc::vec::Vec<MinimalTable>,
532}
533#[allow(clippy::derive_partial_eq_without_eq)]
535#[derive(Clone, PartialEq, ::prost::Message)]
536pub struct VStreamRequest {
537 #[prost(message, optional, tag = "1")]
538 pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
539 #[prost(message, optional, tag = "2")]
540 pub immediate_caller_id: ::core::option::Option<super::query::VtGateCallerId>,
541 #[prost(message, optional, tag = "3")]
542 pub target: ::core::option::Option<super::query::Target>,
543 #[prost(string, tag = "4")]
544 pub position: ::prost::alloc::string::String,
545 #[prost(message, optional, tag = "5")]
546 pub filter: ::core::option::Option<Filter>,
547 #[prost(message, repeated, tag = "6")]
548 pub table_last_p_ks: ::prost::alloc::vec::Vec<TableLastPk>,
549}
550#[allow(clippy::derive_partial_eq_without_eq)]
552#[derive(Clone, PartialEq, ::prost::Message)]
553pub struct VStreamResponse {
554 #[prost(message, repeated, tag = "1")]
555 pub events: ::prost::alloc::vec::Vec<VEvent>,
556}
557#[allow(clippy::derive_partial_eq_without_eq)]
559#[derive(Clone, PartialEq, ::prost::Message)]
560pub struct VStreamRowsRequest {
561 #[prost(message, optional, tag = "1")]
562 pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
563 #[prost(message, optional, tag = "2")]
564 pub immediate_caller_id: ::core::option::Option<super::query::VtGateCallerId>,
565 #[prost(message, optional, tag = "3")]
566 pub target: ::core::option::Option<super::query::Target>,
567 #[prost(string, tag = "4")]
568 pub query: ::prost::alloc::string::String,
569 #[prost(message, optional, tag = "5")]
570 pub lastpk: ::core::option::Option<super::query::QueryResult>,
571}
572#[allow(clippy::derive_partial_eq_without_eq)]
574#[derive(Clone, PartialEq, ::prost::Message)]
575pub struct VStreamRowsResponse {
576 #[prost(message, repeated, tag = "1")]
577 pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
578 #[prost(message, repeated, tag = "2")]
579 pub pkfields: ::prost::alloc::vec::Vec<super::query::Field>,
580 #[prost(string, tag = "3")]
581 pub gtid: ::prost::alloc::string::String,
582 #[prost(message, repeated, tag = "4")]
583 pub rows: ::prost::alloc::vec::Vec<super::query::Row>,
584 #[prost(message, optional, tag = "5")]
585 pub lastpk: ::core::option::Option<super::query::Row>,
586 #[prost(bool, tag = "6")]
588 pub throttled: bool,
589 #[prost(bool, tag = "7")]
591 pub heartbeat: bool,
592}
593#[allow(clippy::derive_partial_eq_without_eq)]
595#[derive(Clone, PartialEq, ::prost::Message)]
596pub struct VStreamTablesRequest {
597 #[prost(message, optional, tag = "1")]
598 pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
599 #[prost(message, optional, tag = "2")]
600 pub immediate_caller_id: ::core::option::Option<super::query::VtGateCallerId>,
601 #[prost(message, optional, tag = "3")]
602 pub target: ::core::option::Option<super::query::Target>,
603}
604#[allow(clippy::derive_partial_eq_without_eq)]
606#[derive(Clone, PartialEq, ::prost::Message)]
607pub struct VStreamTablesResponse {
608 #[prost(string, tag = "1")]
609 pub table_name: ::prost::alloc::string::String,
610 #[prost(message, repeated, tag = "2")]
611 pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
612 #[prost(message, repeated, tag = "3")]
613 pub pkfields: ::prost::alloc::vec::Vec<super::query::Field>,
614 #[prost(string, tag = "4")]
615 pub gtid: ::prost::alloc::string::String,
616 #[prost(message, repeated, tag = "5")]
617 pub rows: ::prost::alloc::vec::Vec<super::query::Row>,
618 #[prost(message, optional, tag = "6")]
619 pub lastpk: ::core::option::Option<super::query::Row>,
620}
621#[allow(clippy::derive_partial_eq_without_eq)]
622#[derive(Clone, PartialEq, ::prost::Message)]
623pub struct LastPkEvent {
624 #[prost(message, optional, tag = "1")]
625 pub table_last_p_k: ::core::option::Option<TableLastPk>,
626 #[prost(bool, tag = "2")]
627 pub completed: bool,
628}
629#[allow(clippy::derive_partial_eq_without_eq)]
630#[derive(Clone, PartialEq, ::prost::Message)]
631pub struct TableLastPk {
632 #[prost(string, tag = "1")]
633 pub table_name: ::prost::alloc::string::String,
634 #[prost(message, optional, tag = "3")]
635 pub lastpk: ::core::option::Option<super::query::QueryResult>,
636}
637#[allow(clippy::derive_partial_eq_without_eq)]
641#[derive(Clone, PartialEq, ::prost::Message)]
642pub struct VStreamResultsRequest {
643 #[prost(message, optional, tag = "1")]
644 pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
645 #[prost(message, optional, tag = "2")]
646 pub immediate_caller_id: ::core::option::Option<super::query::VtGateCallerId>,
647 #[prost(message, optional, tag = "3")]
648 pub target: ::core::option::Option<super::query::Target>,
649 #[prost(string, tag = "4")]
650 pub query: ::prost::alloc::string::String,
651}
652#[allow(clippy::derive_partial_eq_without_eq)]
655#[derive(Clone, PartialEq, ::prost::Message)]
656pub struct VStreamResultsResponse {
657 #[prost(message, repeated, tag = "1")]
658 pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
659 #[prost(string, tag = "3")]
660 pub gtid: ::prost::alloc::string::String,
661 #[prost(message, repeated, tag = "4")]
662 pub rows: ::prost::alloc::vec::Vec<super::query::Row>,
663}
664#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
666#[repr(i32)]
667pub enum OnDdlAction {
668 Ignore = 0,
669 Stop = 1,
670 Exec = 2,
671 ExecIgnore = 3,
672}
673impl OnDdlAction {
674 pub fn as_str_name(&self) -> &'static str {
679 match self {
680 OnDdlAction::Ignore => "IGNORE",
681 OnDdlAction::Stop => "STOP",
682 OnDdlAction::Exec => "EXEC",
683 OnDdlAction::ExecIgnore => "EXEC_IGNORE",
684 }
685 }
686 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
688 match value {
689 "IGNORE" => Some(Self::Ignore),
690 "STOP" => Some(Self::Stop),
691 "EXEC" => Some(Self::Exec),
692 "EXEC_IGNORE" => Some(Self::ExecIgnore),
693 _ => None,
694 }
695 }
696}
697#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
699#[repr(i32)]
700pub enum VReplicationWorkflowType {
701 Materialize = 0,
702 MoveTables = 1,
703 CreateLookupIndex = 2,
704 Migrate = 3,
705 Reshard = 4,
706 OnlineDdl = 5,
707}
708impl VReplicationWorkflowType {
709 pub fn as_str_name(&self) -> &'static str {
714 match self {
715 VReplicationWorkflowType::Materialize => "Materialize",
716 VReplicationWorkflowType::MoveTables => "MoveTables",
717 VReplicationWorkflowType::CreateLookupIndex => "CreateLookupIndex",
718 VReplicationWorkflowType::Migrate => "Migrate",
719 VReplicationWorkflowType::Reshard => "Reshard",
720 VReplicationWorkflowType::OnlineDdl => "OnlineDDL",
721 }
722 }
723 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
725 match value {
726 "Materialize" => Some(Self::Materialize),
727 "MoveTables" => Some(Self::MoveTables),
728 "CreateLookupIndex" => Some(Self::CreateLookupIndex),
729 "Migrate" => Some(Self::Migrate),
730 "Reshard" => Some(Self::Reshard),
731 "OnlineDDL" => Some(Self::OnlineDdl),
732 _ => None,
733 }
734 }
735}
736#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
738#[repr(i32)]
739pub enum VReplicationWorkflowSubType {
740 None = 0,
741 Partial = 1,
742 AtomicCopy = 2,
743}
744impl VReplicationWorkflowSubType {
745 pub fn as_str_name(&self) -> &'static str {
750 match self {
751 VReplicationWorkflowSubType::None => "None",
752 VReplicationWorkflowSubType::Partial => "Partial",
753 VReplicationWorkflowSubType::AtomicCopy => "AtomicCopy",
754 }
755 }
756 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
758 match value {
759 "None" => Some(Self::None),
760 "Partial" => Some(Self::Partial),
761 "AtomicCopy" => Some(Self::AtomicCopy),
762 _ => None,
763 }
764 }
765}
766#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
768#[repr(i32)]
769pub enum VReplicationWorkflowState {
770 Unknown = 0,
771 Init = 1,
772 Stopped = 2,
773 Copying = 3,
774 Running = 4,
775 Error = 5,
776 Lagging = 6,
777}
778impl VReplicationWorkflowState {
779 pub fn as_str_name(&self) -> &'static str {
784 match self {
785 VReplicationWorkflowState::Unknown => "Unknown",
786 VReplicationWorkflowState::Init => "Init",
787 VReplicationWorkflowState::Stopped => "Stopped",
788 VReplicationWorkflowState::Copying => "Copying",
789 VReplicationWorkflowState::Running => "Running",
790 VReplicationWorkflowState::Error => "Error",
791 VReplicationWorkflowState::Lagging => "Lagging",
792 }
793 }
794 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
796 match value {
797 "Unknown" => Some(Self::Unknown),
798 "Init" => Some(Self::Init),
799 "Stopped" => Some(Self::Stopped),
800 "Copying" => Some(Self::Copying),
801 "Running" => Some(Self::Running),
802 "Error" => Some(Self::Error),
803 "Lagging" => Some(Self::Lagging),
804 _ => None,
805 }
806 }
807}
808#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
811#[repr(i32)]
812pub enum VEventType {
813 Unknown = 0,
814 Gtid = 1,
815 Begin = 2,
816 Commit = 3,
817 Rollback = 4,
818 Ddl = 5,
819 Insert = 6,
821 Replace = 7,
822 Update = 8,
823 Delete = 9,
824 Set = 10,
825 Other = 11,
828 Row = 12,
829 Field = 13,
830 Heartbeat = 14,
834 Vgtid = 15,
837 Journal = 16,
838 Version = 17,
839 Lastpk = 18,
840 Savepoint = 19,
841 CopyCompleted = 20,
845}
846impl VEventType {
847 pub fn as_str_name(&self) -> &'static str {
852 match self {
853 VEventType::Unknown => "UNKNOWN",
854 VEventType::Gtid => "GTID",
855 VEventType::Begin => "BEGIN",
856 VEventType::Commit => "COMMIT",
857 VEventType::Rollback => "ROLLBACK",
858 VEventType::Ddl => "DDL",
859 VEventType::Insert => "INSERT",
860 VEventType::Replace => "REPLACE",
861 VEventType::Update => "UPDATE",
862 VEventType::Delete => "DELETE",
863 VEventType::Set => "SET",
864 VEventType::Other => "OTHER",
865 VEventType::Row => "ROW",
866 VEventType::Field => "FIELD",
867 VEventType::Heartbeat => "HEARTBEAT",
868 VEventType::Vgtid => "VGTID",
869 VEventType::Journal => "JOURNAL",
870 VEventType::Version => "VERSION",
871 VEventType::Lastpk => "LASTPK",
872 VEventType::Savepoint => "SAVEPOINT",
873 VEventType::CopyCompleted => "COPY_COMPLETED",
874 }
875 }
876 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
878 match value {
879 "UNKNOWN" => Some(Self::Unknown),
880 "GTID" => Some(Self::Gtid),
881 "BEGIN" => Some(Self::Begin),
882 "COMMIT" => Some(Self::Commit),
883 "ROLLBACK" => Some(Self::Rollback),
884 "DDL" => Some(Self::Ddl),
885 "INSERT" => Some(Self::Insert),
886 "REPLACE" => Some(Self::Replace),
887 "UPDATE" => Some(Self::Update),
888 "DELETE" => Some(Self::Delete),
889 "SET" => Some(Self::Set),
890 "OTHER" => Some(Self::Other),
891 "ROW" => Some(Self::Row),
892 "FIELD" => Some(Self::Field),
893 "HEARTBEAT" => Some(Self::Heartbeat),
894 "VGTID" => Some(Self::Vgtid),
895 "JOURNAL" => Some(Self::Journal),
896 "VERSION" => Some(Self::Version),
897 "LASTPK" => Some(Self::Lastpk),
898 "SAVEPOINT" => Some(Self::Savepoint),
899 "COPY_COMPLETED" => Some(Self::CopyCompleted),
900 _ => None,
901 }
902 }
903}
904#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
906#[repr(i32)]
907pub enum MigrationType {
908 Tables = 0,
909 Shards = 1,
910}
911impl MigrationType {
912 pub fn as_str_name(&self) -> &'static str {
917 match self {
918 MigrationType::Tables => "TABLES",
919 MigrationType::Shards => "SHARDS",
920 }
921 }
922 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
924 match value {
925 "TABLES" => Some(Self::Tables),
926 "SHARDS" => Some(Self::Shards),
927 _ => None,
928 }
929 }
930}