vitess_grpc/generated/
binlogdata.rs

1/// Charset is the per-statement charset info from a QUERY_EVENT binlog entry.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Charset {
5    /// @@session.character_set_client
6    #[prost(int32, tag = "1")]
7    pub client: i32,
8    /// @@session.collation_connection
9    #[prost(int32, tag = "2")]
10    pub conn: i32,
11    /// @@session.collation_server
12    #[prost(int32, tag = "3")]
13    pub server: i32,
14}
15/// BinlogTransaction describes a transaction inside the binlogs.
16/// It is streamed by vttablet for filtered replication, used during resharding.
17#[allow(clippy::derive_partial_eq_without_eq)]
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct BinlogTransaction {
20    /// the statements in this transaction
21    #[prost(message, repeated, tag = "1")]
22    pub statements: ::prost::alloc::vec::Vec<binlog_transaction::Statement>,
23    /// The Event Token for this event.
24    #[prost(message, optional, tag = "4")]
25    pub event_token: ::core::option::Option<super::query::EventToken>,
26}
27/// Nested message and enum types in `BinlogTransaction`.
28pub mod binlog_transaction {
29    #[allow(clippy::derive_partial_eq_without_eq)]
30    #[derive(Clone, PartialEq, ::prost::Message)]
31    pub struct Statement {
32        /// what type of statement is this?
33        #[prost(enumeration = "statement::Category", tag = "1")]
34        pub category: i32,
35        /// charset of this statement, if different from pre-negotiated default.
36        #[prost(message, optional, tag = "2")]
37        pub charset: ::core::option::Option<super::Charset>,
38        /// the sql
39        #[prost(bytes = "vec", tag = "3")]
40        pub sql: ::prost::alloc::vec::Vec<u8>,
41    }
42    /// Nested message and enum types in `Statement`.
43    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            /// BL_DML is deprecated.
62            BlDmlDeprecated = 4,
63            BlDdl = 5,
64            BlSet = 6,
65            BlInsert = 7,
66            BlUpdate = 8,
67            BlDelete = 9,
68        }
69        impl Category {
70            /// String value of the enum field names used in the ProtoBuf definition.
71            ///
72            /// The values are not transformed in any way and thus are considered stable
73            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
74            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            /// Creates an enum from field names used in the ProtoBuf definition.
89            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/// StreamKeyRangeRequest is the payload to StreamKeyRange
108#[allow(clippy::derive_partial_eq_without_eq)]
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct StreamKeyRangeRequest {
111    /// where to start
112    #[prost(string, tag = "1")]
113    pub position: ::prost::alloc::string::String,
114    /// what to get
115    #[prost(message, optional, tag = "2")]
116    pub key_range: ::core::option::Option<super::topodata::KeyRange>,
117    /// default charset on the player side
118    #[prost(message, optional, tag = "3")]
119    pub charset: ::core::option::Option<Charset>,
120}
121/// StreamKeyRangeResponse is the response from StreamKeyRange
122#[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/// StreamTablesRequest is the payload to StreamTables
129#[allow(clippy::derive_partial_eq_without_eq)]
130#[derive(Clone, PartialEq, ::prost::Message)]
131pub struct StreamTablesRequest {
132    /// where to start
133    #[prost(string, tag = "1")]
134    pub position: ::prost::alloc::string::String,
135    /// what to get
136    #[prost(string, repeated, tag = "2")]
137    pub tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
138    /// default charset on the player side
139    #[prost(message, optional, tag = "3")]
140    pub charset: ::core::option::Option<Charset>,
141}
142/// StreamTablesResponse is the response from StreamTables
143#[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/// CharsetConversion represent a conversion of text from one charset to another
150#[allow(clippy::derive_partial_eq_without_eq)]
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct CharsetConversion {
153    /// FromCharset is the charset name from which we convert the text (e.g. latin1)
154    #[prost(string, tag = "1")]
155    pub from_charset: ::prost::alloc::string::String,
156    /// ToCharset is the charset name to which we convert the text (e.g. utf8mb4)
157    #[prost(string, tag = "2")]
158    pub to_charset: ::prost::alloc::string::String,
159}
160/// Rule represents one rule in a Filter.
161#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct Rule {
164    /// Match can be a table name or a regular expression.
165    /// If it starts with a '/', it's a regular expression.
166    /// For example, "t" matches a table named "t", whereas
167    /// "/t.*" matches all tables that begin with 't'.
168    #[prost(string, tag = "1")]
169    pub r#match: ::prost::alloc::string::String,
170    /// Filter: If empty, all columns and rows of the matching tables
171    /// are sent. If it's a keyrange like "-80", only rows that
172    /// match the keyrange are sent.
173    /// If Match is a table name instead of a regular expression,
174    /// the Filter can also be a select expression like this:
175    /// "select * from t", same as an empty Filter, or
176    /// "select * from t where in_keyrange('-80')", same as "-80", or
177    /// "select col1, col2 from t where in_keyrange(col1, 'hash', '-80'), or
178    /// What is allowed in a select expression depends on whether
179    /// it's a vstreamer or vreplication request. For more details,
180    /// please refer to the specific package documentation.
181    /// On the vreplication side, Filter can also accept a special
182    /// "exclude" value, which will cause the matched tables
183    /// to be excluded.
184    /// TODO(sougou): support this on vstreamer side also.
185    ///
186    /// ConvertEnumToText: optional, list per enum column name, the list of textual values.
187    /// When reading the binary log, all enum values are numeric. But sometimes it
188    /// is useful/needed to know what the textual mapping are.
189    /// Online DDL provides such use case.
190    #[prost(string, tag = "2")]
191    pub filter: ::prost::alloc::string::String,
192    /// Example: key="color", value="'red','green','blue'"
193    #[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    /// ConvertCharset: optional mapping, between column name and a CharsetConversion.
199    /// This hints to vreplication that columns are encoded from/to non-trivial charsets
200    /// The map is only populated when either "from" or "to" charset of a column are non-trivial
201    /// trivial charsets are utf8 and ascii variants.
202    #[prost(map = "string, message", tag = "4")]
203    pub convert_charset: ::std::collections::HashMap<
204        ::prost::alloc::string::String,
205        CharsetConversion,
206    >,
207    /// SourceUniqueKeyColumns represents the ordered columns in the index used by rowstreamer to iterate the table
208    /// It is comma delimited, as in col1,col2,col3 (tokens are escaped via net/url)
209    #[prost(string, tag = "5")]
210    pub source_unique_key_columns: ::prost::alloc::string::String,
211    /// TargetUniqueKeyColumns represents the ordered columns in that index used by vcopier and vplayer to apply rows
212    /// It is comma delimited, as in col1,col2,col3 (tokens are escaped via net/url)
213    #[prost(string, tag = "6")]
214    pub target_unique_key_columns: ::prost::alloc::string::String,
215    /// SourceUniqueKeyTargetColumns represents the names of columns in target table, mapped from the chosen unique
216    /// key on source tables (some columns may be renamed from source to target)
217    #[prost(string, tag = "7")]
218    pub source_unique_key_target_columns: ::prost::alloc::string::String,
219    /// ConvertIntToEnum lists any columns that are converted from an integral value into an enum.
220    /// such columns need to have special transofrmation of the data, from an integral format into a
221    /// string format. e.g. the value 0 needs to be converted to '0'.
222    #[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/// Filter represents a list of ordered rules. The first
229/// match wins.
230#[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    /// FieldEventMode specifies the behavior if there is a mismatch
236    /// between the current schema and the fields in the binlog. This
237    /// can happen if the binlog position is before a DDL that would
238    /// cause the fields to change. If vstreamer detects such
239    /// an inconsistency, the behavior depends on the FieldEventMode.
240    /// If the value is ERR_ON_MISMATCH (default), then it errors out.
241    /// If it's BEST_EFFORT, it sends a field event with fake column
242    /// names as "@1", "@2", etc.
243    #[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}
250/// Nested message and enum types in `Filter`.
251pub 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        /// String value of the enum field names used in the ProtoBuf definition.
270        ///
271        /// The values are not transformed in any way and thus are considered stable
272        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
273        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        /// Creates an enum from field names used in the ProtoBuf definition.
280        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/// BinlogSource specifies the source  and filter parameters for
290/// Filtered Replication. KeyRange and Tables are legacy. Filter
291/// is the new way to specify the filtering rules.
292#[allow(clippy::derive_partial_eq_without_eq)]
293#[derive(Clone, PartialEq, ::prost::Message)]
294pub struct BinlogSource {
295    /// the source keyspace
296    #[prost(string, tag = "1")]
297    pub keyspace: ::prost::alloc::string::String,
298    /// the source shard
299    #[prost(string, tag = "2")]
300    pub shard: ::prost::alloc::string::String,
301    /// the source tablet type
302    #[prost(enumeration = "super::topodata::TabletType", tag = "3")]
303    pub tablet_type: i32,
304    /// KeyRange is set if the request is for a keyrange
305    #[prost(message, optional, tag = "4")]
306    pub key_range: ::core::option::Option<super::topodata::KeyRange>,
307    /// Tables is set if the request is for a list of tables
308    #[prost(string, repeated, tag = "5")]
309    pub tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
310    /// Filter is set if we're using the generalized representation
311    /// for the filter.
312    #[prost(message, optional, tag = "6")]
313    pub filter: ::core::option::Option<Filter>,
314    /// OnDdl specifies the action to be taken when a DDL is encountered.
315    #[prost(enumeration = "OnDdlAction", tag = "7")]
316    pub on_ddl: i32,
317    /// Source is an external mysql. This attribute should be set to the username
318    /// to use in the connection
319    #[prost(string, tag = "8")]
320    pub external_mysql: ::prost::alloc::string::String,
321    /// StopAfterCopy specifies if vreplication should be stopped
322    /// after copying is done.
323    #[prost(bool, tag = "9")]
324    pub stop_after_copy: bool,
325    /// ExternalCluster is the name of the mounted cluster which has the source keyspace/db for this workflow
326    /// it is of the type <cluster_type.cluster_name>
327    #[prost(string, tag = "10")]
328    pub external_cluster: ::prost::alloc::string::String,
329    /// SourceTimeZone is the time zone in which datetimes on the source were stored, provided as an option in MoveTables
330    #[prost(string, tag = "11")]
331    pub source_time_zone: ::prost::alloc::string::String,
332    /// TargetTimeZone is not currently specifiable by the user, defaults to UTC for the forward workflows
333    /// and to the SourceTimeZone in reverse workflows
334    #[prost(string, tag = "12")]
335    pub target_time_zone: ::prost::alloc::string::String,
336}
337/// RowChange represents one row change.
338/// If Before is set and not After, it's a delete.
339/// If After is set and not Before, it's an insert.
340/// If both are set, it's an update.
341#[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    /// DataColumns is a bitmap of all columns: bit is set if column is present in the after image
349    #[prost(message, optional, tag = "3")]
350    pub data_columns: ::core::option::Option<row_change::Bitmap>,
351}
352/// Nested message and enum types in `RowChange`.
353pub 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/// RowEvent represent row events for one table.
364#[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    /// <https://dev.mysql.com/doc/dev/mysql-server/latest/classbinary__log_1_1Rows__event.html>
376    #[prost(uint32, tag = "5")]
377    pub flags: u32,
378}
379/// FieldEvent represents the field info for a table.
380#[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/// ShardGtid contains the GTID position for one shard.
393/// It's used in a request for requesting a starting position.
394/// It's used in a response to transmit the current position
395/// of a shard. It's also used in a Journal to indicate the
396/// list of targets and shard positions to migrate to.
397#[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/// A VGtid is a list of ShardGtids.
410#[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/// KeyspaceShard represents a keyspace and shard.
417#[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/// Journal contains the metadata for a journal event.
426/// The commit of a journal event indicates the point of no return
427/// for a migration.
428#[allow(clippy::derive_partial_eq_without_eq)]
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct Journal {
431    /// Id represents a unique journal id.
432    #[prost(int64, tag = "1")]
433    pub id: i64,
434    #[prost(enumeration = "MigrationType", tag = "2")]
435    pub migration_type: i32,
436    /// Tables is set if the journal represents a TABLES migration.
437    #[prost(string, repeated, tag = "3")]
438    pub tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
439    /// LocalPosition is the source position at which the migration happened.
440    #[prost(string, tag = "4")]
441    pub local_position: ::prost::alloc::string::String,
442    /// ShardGtids is the list of targets to which the migration took place.
443    #[prost(message, repeated, tag = "5")]
444    pub shard_gtids: ::prost::alloc::vec::Vec<ShardGtid>,
445    /// Participants is the list of source participants for a migration.
446    /// Every participant is expected to have an identical journal entry.
447    /// While streaming, the client must wait for the journal entry to
448    /// be received from all pariticipants, and then replace them with new
449    /// streams specified by ShardGtid.
450    /// If a stream does not have all participants, a consistent migration
451    /// is not possible.
452    #[prost(message, repeated, tag = "6")]
453    pub participants: ::prost::alloc::vec::Vec<KeyspaceShard>,
454    /// SourceWorkflows is the list of workflows in the source shard that
455    /// were migrated to the target. If a migration fails after a Journal
456    /// is committed, this information is used to start the target streams
457    /// that were created prior to the creation of the journal.
458    #[prost(string, repeated, tag = "7")]
459    pub source_workflows: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
460}
461/// VEvent represents a vstream event.
462/// A FieldEvent is sent once for every table, just before
463/// the first event for that table. The client is expected
464/// to cache this information and match it against the RowEvent
465/// which contains the table name.
466/// A GTID event always precedes a commitable event, which can be
467/// COMMIT, DDL or OTHER.
468/// OTHER events are non-material events that have no additional metadata.
469#[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    /// Timestamp is the binlog timestamp in seconds.
475    /// The value should be ignored if 0.
476    #[prost(int64, tag = "2")]
477    pub timestamp: i64,
478    /// Gtid is set if the event type is GTID.
479    #[prost(string, tag = "3")]
480    pub gtid: ::prost::alloc::string::String,
481    /// Statement is set if the event type is DDL, DML or SAVEPOINT.
482    #[prost(string, tag = "4")]
483    pub statement: ::prost::alloc::string::String,
484    /// RowEvent is set if the event type is ROW.
485    #[prost(message, optional, tag = "5")]
486    pub row_event: ::core::option::Option<RowEvent>,
487    /// FieldEvent is set if the event type is FIELD.
488    #[prost(message, optional, tag = "6")]
489    pub field_event: ::core::option::Option<FieldEvent>,
490    /// Vgtid is set if the event type is VGTID.
491    /// This event is only generated by VTGate's VStream function.
492    #[prost(message, optional, tag = "7")]
493    pub vgtid: ::core::option::Option<VGtid>,
494    /// Journal is set if the event type is JOURNAL.
495    #[prost(message, optional, tag = "8")]
496    pub journal: ::core::option::Option<Journal>,
497    /// Dml is set if the event type is INSERT, REPLACE, UPDATE or DELETE.
498    #[prost(string, tag = "9")]
499    pub dml: ::prost::alloc::string::String,
500    /// CurrentTime specifies the current time when the message was sent.
501    /// This can be used to compenssate for clock skew.
502    #[prost(int64, tag = "20")]
503    pub current_time: i64,
504    /// LastPK is the last PK for a table
505    #[prost(message, optional, tag = "21")]
506    pub last_p_k_event: ::core::option::Option<LastPkEvent>,
507    /// the source keyspace
508    #[prost(string, tag = "22")]
509    pub keyspace: ::prost::alloc::string::String,
510    /// the source shard
511    #[prost(string, tag = "23")]
512    pub shard: ::prost::alloc::string::String,
513    /// indicate that we are being throttled right now
514    #[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/// VStreamRequest is the payload for VStreamer
534#[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/// VStreamResponse is the response from VStreamer
551#[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/// VStreamRowsRequest is the payload for VStreamRows
558#[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/// VStreamRowsResponse is the response from VStreamRows
573#[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    /// Throttled indicates that rowstreamer is being throttled right now
587    #[prost(bool, tag = "6")]
588    pub throttled: bool,
589    /// Heartbeat indicates that this is a heartbeat message
590    #[prost(bool, tag = "7")]
591    pub heartbeat: bool,
592}
593/// VStreamTablesRequest is the payload for VStreamTables
594#[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/// VStreamTablesResponse is the response from VStreamTables
605#[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/// VStreamResultsRequest is the payload for VStreamResults
638/// The ids match VStreamRows, in case we decide to merge the two.
639/// The ids match VStreamRows, in case we decide to merge the two.
640#[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/// VStreamResultsResponse is the response from VStreamResults
653/// The ids match VStreamRows, in case we decide to merge the two.
654#[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/// OnDDLAction lists the possible actions for DDLs.
665#[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    /// String value of the enum field names used in the ProtoBuf definition.
675    ///
676    /// The values are not transformed in any way and thus are considered stable
677    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
678    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    /// Creates an enum from field names used in the ProtoBuf definition.
687    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/// VReplicationWorkflowType define types of vreplication workflows.
698#[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    /// String value of the enum field names used in the ProtoBuf definition.
710    ///
711    /// The values are not transformed in any way and thus are considered stable
712    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
713    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    /// Creates an enum from field names used in the ProtoBuf definition.
724    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/// VReplicationWorkflowSubType define types of vreplication workflows.
737#[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    /// String value of the enum field names used in the ProtoBuf definition.
746    ///
747    /// The values are not transformed in any way and thus are considered stable
748    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
749    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    /// Creates an enum from field names used in the ProtoBuf definition.
757    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/// VReplicationWorklfowState defines the valid states that a workflow can be in.
767#[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    /// String value of the enum field names used in the ProtoBuf definition.
780    ///
781    /// The values are not transformed in any way and thus are considered stable
782    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
783    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    /// Creates an enum from field names used in the ProtoBuf definition.
795    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/// VEventType enumerates the event types. Many of these types
809/// will not be encountered in RBR mode.
810#[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, REPLACE, UPDATE, DELETE and SET will not be seen in RBR mode.
820    Insert = 6,
821    Replace = 7,
822    Update = 8,
823    Delete = 9,
824    Set = 10,
825    /// OTHER is a dummy event. If encountered, the current GTID must be
826    /// recorded by the client to be able to resume.
827    Other = 11,
828    Row = 12,
829    Field = 13,
830    /// HEARTBEAT is sent if there is inactivity. If a client does not
831    /// receive events beyond the hearbeat interval, it can assume that it's
832    /// lost connection to the vstreamer.
833    Heartbeat = 14,
834    /// VGTID is generated by VTGate's VStream that combines multiple
835    /// GTIDs.
836    Vgtid = 15,
837    Journal = 16,
838    Version = 17,
839    Lastpk = 18,
840    Savepoint = 19,
841    /// COPY_COMPLETED is sent when VTGate's VStream copy operation is done.
842    /// If a client experiences some disruptions before receiving the event,
843    /// the client should restart the copy operation.
844    CopyCompleted = 20,
845}
846impl VEventType {
847    /// String value of the enum field names used in the ProtoBuf definition.
848    ///
849    /// The values are not transformed in any way and thus are considered stable
850    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
851    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    /// Creates an enum from field names used in the ProtoBuf definition.
877    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/// MigrationType specifies the type of migration for the Journal.
905#[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    /// String value of the enum field names used in the ProtoBuf definition.
913    ///
914    /// The values are not transformed in any way and thus are considered stable
915    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
916    pub fn as_str_name(&self) -> &'static str {
917        match self {
918            MigrationType::Tables => "TABLES",
919            MigrationType::Shards => "SHARDS",
920        }
921    }
922    /// Creates an enum from field names used in the ProtoBuf definition.
923    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}