1#[allow(clippy::derive_partial_eq_without_eq)]
12#[derive(Clone, PartialEq, ::prost::Message)]
13pub struct Session {
14 #[prost(bool, tag = "1")]
16 pub in_transaction: bool,
17 #[prost(message, repeated, tag = "2")]
19 pub shard_sessions: ::prost::alloc::vec::Vec<session::ShardSession>,
20 #[prost(bool, tag = "4")]
23 pub autocommit: bool,
24 #[prost(string, tag = "5")]
28 pub target_string: ::prost::alloc::string::String,
29 #[prost(message, optional, tag = "6")]
31 pub options: ::core::option::Option<super::query::ExecuteOptions>,
32 #[prost(enumeration = "TransactionMode", tag = "7")]
34 pub transaction_mode: i32,
35 #[prost(message, repeated, tag = "8")]
37 pub warnings: ::prost::alloc::vec::Vec<super::query::QueryWarning>,
38 #[prost(message, repeated, tag = "9")]
40 pub pre_sessions: ::prost::alloc::vec::Vec<session::ShardSession>,
41 #[prost(message, repeated, tag = "10")]
43 pub post_sessions: ::prost::alloc::vec::Vec<session::ShardSession>,
44 #[prost(uint64, tag = "11")]
46 pub last_insert_id: u64,
47 #[prost(uint64, tag = "12")]
49 pub found_rows: u64,
50 #[prost(map = "string, message", tag = "13")]
52 pub user_defined_variables: ::std::collections::HashMap<
53 ::prost::alloc::string::String,
54 super::query::BindVariable,
55 >,
56 #[prost(map = "string, string", tag = "14")]
59 pub system_variables: ::std::collections::HashMap<
60 ::prost::alloc::string::String,
61 ::prost::alloc::string::String,
62 >,
63 #[prost(int64, tag = "15")]
65 pub row_count: i64,
66 #[prost(string, repeated, tag = "16")]
69 pub savepoints: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
70 #[prost(bool, tag = "17")]
72 pub in_reserved_conn: bool,
73 #[prost(message, optional, tag = "18")]
75 pub lock_session: ::core::option::Option<session::ShardSession>,
76 #[prost(int64, tag = "19")]
78 pub last_lock_heartbeat: i64,
79 #[prost(message, optional, tag = "20")]
81 pub read_after_write: ::core::option::Option<ReadAfterWrite>,
82 #[prost(string, tag = "21")]
84 pub ddl_strategy: ::prost::alloc::string::String,
85 #[prost(string, tag = "22")]
87 pub session_uuid: ::prost::alloc::string::String,
88 #[prost(bool, tag = "23")]
90 pub enable_system_settings: bool,
91 #[prost(map = "string, int64", tag = "24")]
92 pub advisory_lock: ::std::collections::HashMap<::prost::alloc::string::String, i64>,
93 #[prost(int64, tag = "25")]
95 pub query_timeout: i64,
96 #[prost(map = "string, message", tag = "26")]
97 pub prepare_statement: ::std::collections::HashMap<
98 ::prost::alloc::string::String,
99 PrepareData,
100 >,
101 #[prost(string, tag = "27")]
103 pub migration_context: ::prost::alloc::string::String,
104}
105pub mod session {
107 #[allow(clippy::derive_partial_eq_without_eq)]
108 #[derive(Clone, PartialEq, ::prost::Message)]
109 pub struct ShardSession {
110 #[prost(message, optional, tag = "1")]
111 pub target: ::core::option::Option<super::super::query::Target>,
112 #[prost(int64, tag = "2")]
113 pub transaction_id: i64,
114 #[prost(message, optional, tag = "3")]
115 pub tablet_alias: ::core::option::Option<super::super::topodata::TabletAlias>,
116 #[prost(int64, tag = "4")]
118 pub reserved_id: i64,
119 #[prost(bool, tag = "5")]
120 pub vindex_only: bool,
121 }
122}
123#[allow(clippy::derive_partial_eq_without_eq)]
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct PrepareData {
127 #[prost(string, tag = "1")]
128 pub prepare_statement: ::prost::alloc::string::String,
129 #[prost(int32, tag = "2")]
130 pub params_count: i32,
131}
132#[allow(clippy::derive_partial_eq_without_eq)]
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct ReadAfterWrite {
137 #[prost(string, tag = "1")]
138 pub read_after_write_gtid: ::prost::alloc::string::String,
139 #[prost(double, tag = "2")]
140 pub read_after_write_timeout: f64,
141 #[prost(bool, tag = "3")]
142 pub session_track_gtids: bool,
143}
144#[allow(clippy::derive_partial_eq_without_eq)]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct ExecuteRequest {
148 #[prost(message, optional, tag = "1")]
151 pub caller_id: ::core::option::Option<super::vtrpc::CallerId>,
152 #[prost(message, optional, tag = "2")]
154 pub session: ::core::option::Option<Session>,
155 #[prost(message, optional, tag = "3")]
157 pub query: ::core::option::Option<super::query::BoundQuery>,
158}
159#[allow(clippy::derive_partial_eq_without_eq)]
161#[derive(Clone, PartialEq, ::prost::Message)]
162pub struct ExecuteResponse {
163 #[prost(message, optional, tag = "1")]
167 pub error: ::core::option::Option<super::vtrpc::RpcError>,
168 #[prost(message, optional, tag = "2")]
170 pub session: ::core::option::Option<Session>,
171 #[prost(message, optional, tag = "3")]
173 pub result: ::core::option::Option<super::query::QueryResult>,
174}
175#[allow(clippy::derive_partial_eq_without_eq)]
177#[derive(Clone, PartialEq, ::prost::Message)]
178pub struct ExecuteBatchRequest {
179 #[prost(message, optional, tag = "1")]
182 pub caller_id: ::core::option::Option<super::vtrpc::CallerId>,
183 #[prost(message, optional, tag = "2")]
185 pub session: ::core::option::Option<Session>,
186 #[prost(message, repeated, tag = "3")]
188 pub queries: ::prost::alloc::vec::Vec<super::query::BoundQuery>,
189}
190#[allow(clippy::derive_partial_eq_without_eq)]
192#[derive(Clone, PartialEq, ::prost::Message)]
193pub struct ExecuteBatchResponse {
194 #[prost(message, optional, tag = "1")]
198 pub error: ::core::option::Option<super::vtrpc::RpcError>,
199 #[prost(message, optional, tag = "2")]
201 pub session: ::core::option::Option<Session>,
202 #[prost(message, repeated, tag = "3")]
204 pub results: ::prost::alloc::vec::Vec<super::query::ResultWithError>,
205}
206#[allow(clippy::derive_partial_eq_without_eq)]
208#[derive(Clone, PartialEq, ::prost::Message)]
209pub struct StreamExecuteRequest {
210 #[prost(message, optional, tag = "1")]
213 pub caller_id: ::core::option::Option<super::vtrpc::CallerId>,
214 #[prost(message, optional, tag = "2")]
216 pub query: ::core::option::Option<super::query::BoundQuery>,
217 #[prost(message, optional, tag = "6")]
219 pub session: ::core::option::Option<Session>,
220}
221#[allow(clippy::derive_partial_eq_without_eq)]
225#[derive(Clone, PartialEq, ::prost::Message)]
226pub struct StreamExecuteResponse {
227 #[prost(message, optional, tag = "1")]
231 pub result: ::core::option::Option<super::query::QueryResult>,
232 #[prost(message, optional, tag = "2")]
234 pub session: ::core::option::Option<Session>,
235}
236#[allow(clippy::derive_partial_eq_without_eq)]
238#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct ResolveTransactionRequest {
240 #[prost(message, optional, tag = "1")]
243 pub caller_id: ::core::option::Option<super::vtrpc::CallerId>,
244 #[prost(string, tag = "2")]
246 pub dtid: ::prost::alloc::string::String,
247}
248#[allow(clippy::derive_partial_eq_without_eq)]
250#[derive(Clone, PartialEq, ::prost::Message)]
251pub struct ResolveTransactionResponse {}
252#[allow(clippy::derive_partial_eq_without_eq)]
253#[derive(Clone, PartialEq, ::prost::Message)]
254pub struct VStreamFlags {
255 #[prost(bool, tag = "1")]
257 pub minimize_skew: bool,
258 #[prost(uint32, tag = "2")]
260 pub heartbeat_interval: u32,
261 #[prost(bool, tag = "3")]
263 pub stop_on_reshard: bool,
264 #[prost(string, tag = "4")]
267 pub cells: ::prost::alloc::string::String,
268 #[prost(string, tag = "5")]
269 pub cell_preference: ::prost::alloc::string::String,
270 #[prost(string, tag = "6")]
271 pub tablet_order: ::prost::alloc::string::String,
272}
273#[allow(clippy::derive_partial_eq_without_eq)]
275#[derive(Clone, PartialEq, ::prost::Message)]
276pub struct VStreamRequest {
277 #[prost(message, optional, tag = "1")]
278 pub caller_id: ::core::option::Option<super::vtrpc::CallerId>,
279 #[prost(enumeration = "super::topodata::TabletType", tag = "2")]
280 pub tablet_type: i32,
281 #[prost(message, optional, tag = "3")]
285 pub vgtid: ::core::option::Option<super::binlogdata::VGtid>,
286 #[prost(message, optional, tag = "4")]
287 pub filter: ::core::option::Option<super::binlogdata::Filter>,
288 #[prost(message, optional, tag = "5")]
289 pub flags: ::core::option::Option<VStreamFlags>,
290}
291#[allow(clippy::derive_partial_eq_without_eq)]
293#[derive(Clone, PartialEq, ::prost::Message)]
294pub struct VStreamResponse {
295 #[prost(message, repeated, tag = "1")]
296 pub events: ::prost::alloc::vec::Vec<super::binlogdata::VEvent>,
297}
298#[allow(clippy::derive_partial_eq_without_eq)]
300#[derive(Clone, PartialEq, ::prost::Message)]
301pub struct PrepareRequest {
302 #[prost(message, optional, tag = "1")]
305 pub caller_id: ::core::option::Option<super::vtrpc::CallerId>,
306 #[prost(message, optional, tag = "2")]
308 pub session: ::core::option::Option<Session>,
309 #[prost(message, optional, tag = "3")]
311 pub query: ::core::option::Option<super::query::BoundQuery>,
312}
313#[allow(clippy::derive_partial_eq_without_eq)]
315#[derive(Clone, PartialEq, ::prost::Message)]
316pub struct PrepareResponse {
317 #[prost(message, optional, tag = "1")]
321 pub error: ::core::option::Option<super::vtrpc::RpcError>,
322 #[prost(message, optional, tag = "2")]
324 pub session: ::core::option::Option<Session>,
325 #[prost(message, repeated, tag = "3")]
327 pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
328}
329#[allow(clippy::derive_partial_eq_without_eq)]
331#[derive(Clone, PartialEq, ::prost::Message)]
332pub struct CloseSessionRequest {
333 #[prost(message, optional, tag = "1")]
336 pub caller_id: ::core::option::Option<super::vtrpc::CallerId>,
337 #[prost(message, optional, tag = "2")]
339 pub session: ::core::option::Option<Session>,
340}
341#[allow(clippy::derive_partial_eq_without_eq)]
343#[derive(Clone, PartialEq, ::prost::Message)]
344pub struct CloseSessionResponse {
345 #[prost(message, optional, tag = "1")]
349 pub error: ::core::option::Option<super::vtrpc::RpcError>,
350}
351#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
354#[repr(i32)]
355pub enum TransactionMode {
356 Unspecified = 0,
358 Single = 1,
360 Multi = 2,
362 Twopc = 3,
364}
365impl TransactionMode {
366 pub fn as_str_name(&self) -> &'static str {
371 match self {
372 TransactionMode::Unspecified => "UNSPECIFIED",
373 TransactionMode::Single => "SINGLE",
374 TransactionMode::Multi => "MULTI",
375 TransactionMode::Twopc => "TWOPC",
376 }
377 }
378 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
380 match value {
381 "UNSPECIFIED" => Some(Self::Unspecified),
382 "SINGLE" => Some(Self::Single),
383 "MULTI" => Some(Self::Multi),
384 "TWOPC" => Some(Self::Twopc),
385 _ => None,
386 }
387 }
388}
389#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
392#[repr(i32)]
393pub enum CommitOrder {
394 Normal = 0,
396 Pre = 1,
398 Post = 2,
400 Autocommit = 3,
402}
403impl CommitOrder {
404 pub fn as_str_name(&self) -> &'static str {
409 match self {
410 CommitOrder::Normal => "NORMAL",
411 CommitOrder::Pre => "PRE",
412 CommitOrder::Post => "POST",
413 CommitOrder::Autocommit => "AUTOCOMMIT",
414 }
415 }
416 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
418 match value {
419 "NORMAL" => Some(Self::Normal),
420 "PRE" => Some(Self::Pre),
421 "POST" => Some(Self::Post),
422 "AUTOCOMMIT" => Some(Self::Autocommit),
423 _ => None,
424 }
425 }
426}