vitess-grpc 0.1.1

Vitess gRPC client library, auto-generated from the Vitess proto files using tonic-build.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
/// Target describes what the client expects the tablet is.
/// If the tablet does not match, an error is returned.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Target {
    #[prost(string, tag = "1")]
    pub keyspace: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub shard: ::prost::alloc::string::String,
    #[prost(enumeration = "super::topodata::TabletType", tag = "3")]
    pub tablet_type: i32,
    /// cell is used for routing queries between vtgate and vttablets. It
    /// is not used when Target is part of the Session sent by the client.
    #[prost(string, tag = "4")]
    pub cell: ::prost::alloc::string::String,
}
/// VTGateCallerID is sent by VTGate to VTTablet to describe the
/// caller. If possible, this information is secure. For instance,
/// if using unique certificates that guarantee that VTGate->VTTablet
/// traffic cannot be spoofed, then VTTablet can trust this information,
/// and VTTablet will use it for tablet ACLs, for instance.
/// Because of this security guarantee, this is different than the CallerID
/// structure, which is not secure at all, because it is provided
/// by the Vitess client.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VtGateCallerId {
    #[prost(string, tag = "1")]
    pub username: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "2")]
    pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// EventToken is a structure that describes a point in time in a
/// replication stream on one shard. The most recent known replication
/// position can be retrieved from vttablet when executing a query. It
/// is also sent with the replication streams from the binlog service.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventToken {
    /// timestamp is the MySQL timestamp of the statements. Seconds since Epoch.
    #[prost(int64, tag = "1")]
    pub timestamp: i64,
    /// The shard name that applied the statements. Note this is not set when
    /// streaming from a vttablet. It is only used on the client -> vtgate link.
    #[prost(string, tag = "2")]
    pub shard: ::prost::alloc::string::String,
    /// The position on the replication stream after this statement was applied.
    /// It is not the transaction ID / GTID, but the position / GTIDSet.
    #[prost(string, tag = "3")]
    pub position: ::prost::alloc::string::String,
}
/// Value represents a typed value.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Value {
    #[prost(enumeration = "Type", tag = "1")]
    pub r#type: i32,
    #[prost(bytes = "vec", tag = "2")]
    pub value: ::prost::alloc::vec::Vec<u8>,
}
/// BindVariable represents a single bind variable in a Query.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BindVariable {
    #[prost(enumeration = "Type", tag = "1")]
    pub r#type: i32,
    #[prost(bytes = "vec", tag = "2")]
    pub value: ::prost::alloc::vec::Vec<u8>,
    /// values are set if type is TUPLE.
    #[prost(message, repeated, tag = "3")]
    pub values: ::prost::alloc::vec::Vec<Value>,
}
/// BoundQuery is a query with its bind variables
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BoundQuery {
    /// sql is the SQL query to execute
    #[prost(string, tag = "1")]
    pub sql: ::prost::alloc::string::String,
    /// bind_variables is a map of all bind variables to expand in the query.
    /// nil values are not allowed. Use NULL_TYPE to express a NULL value.
    #[prost(map = "string, message", tag = "2")]
    pub bind_variables: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        BindVariable,
    >,
}
/// ExecuteOptions is passed around for all Execute calls.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteOptions {
    /// Controls what fields are returned in Field message responses from mysql, i.e.
    /// field name, table name, etc. This is an optimization for high-QPS queries where
    /// the client knows what it's getting
    #[prost(enumeration = "execute_options::IncludedFields", tag = "4")]
    pub included_fields: i32,
    /// client_rows_found specifies if rows_affected should return
    /// rows found instead of rows affected. Behavior is defined
    /// by MySQL's CLIENT_FOUND_ROWS flag.
    #[prost(bool, tag = "5")]
    pub client_found_rows: bool,
    /// workload specifies the type of workload:
    /// OLTP: DMLs allowed, results have row count limit, and
    /// query timeouts are shorter.
    /// OLAP: DMLS not allowed, no limit on row count, timeouts
    /// can be as high as desired.
    /// DBA: no limit on rowcount or timeout, all queries allowed
    /// but intended for long DMLs and DDLs.
    #[prost(enumeration = "execute_options::Workload", tag = "6")]
    pub workload: i32,
    /// sql_select_limit sets an implicit limit on all select statements. Since
    /// vitess also sets a rowcount limit on queries, the smallest value wins.
    #[prost(int64, tag = "8")]
    pub sql_select_limit: i64,
    #[prost(enumeration = "execute_options::TransactionIsolation", tag = "9")]
    pub transaction_isolation: i32,
    /// skip_query_plan_cache specifies if the query plan should be cached by vitess.
    /// By default all query plans are cached.
    #[prost(bool, tag = "10")]
    pub skip_query_plan_cache: bool,
    /// PlannerVersion specifies which planner to use.
    /// If DEFAULT is chosen, whatever vtgate was started with will be used
    #[prost(enumeration = "execute_options::PlannerVersion", tag = "11")]
    pub planner_version: i32,
    /// has_created_temp_tables signals whether plans created in this session should be cached or not
    /// if the user has created temp tables, Vitess will not reuse plans created for this session in other sessions.
    /// The current session can still use other sessions cached plans.
    #[prost(bool, tag = "12")]
    pub has_created_temp_tables: bool,
}
/// Nested message and enum types in `ExecuteOptions`.
pub mod execute_options {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum IncludedFields {
        TypeAndName = 0,
        TypeOnly = 1,
        All = 2,
    }
    impl IncludedFields {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                IncludedFields::TypeAndName => "TYPE_AND_NAME",
                IncludedFields::TypeOnly => "TYPE_ONLY",
                IncludedFields::All => "ALL",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "TYPE_AND_NAME" => Some(Self::TypeAndName),
                "TYPE_ONLY" => Some(Self::TypeOnly),
                "ALL" => Some(Self::All),
                _ => None,
            }
        }
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Workload {
        Unspecified = 0,
        Oltp = 1,
        Olap = 2,
        Dba = 3,
    }
    impl Workload {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Workload::Unspecified => "UNSPECIFIED",
                Workload::Oltp => "OLTP",
                Workload::Olap => "OLAP",
                Workload::Dba => "DBA",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNSPECIFIED" => Some(Self::Unspecified),
                "OLTP" => Some(Self::Oltp),
                "OLAP" => Some(Self::Olap),
                "DBA" => Some(Self::Dba),
                _ => None,
            }
        }
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum TransactionIsolation {
        Default = 0,
        RepeatableRead = 1,
        ReadCommitted = 2,
        ReadUncommitted = 3,
        Serializable = 4,
        /// This is not an "official" transaction level but it will do a
        /// START TRANSACTION WITH CONSISTENT SNAPSHOT, READ ONLY
        ConsistentSnapshotReadOnly = 5,
        /// This not an "official" transaction level, it will send queries to mysql
        /// without wrapping them in a transaction
        Autocommit = 6,
    }
    impl TransactionIsolation {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                TransactionIsolation::Default => "DEFAULT",
                TransactionIsolation::RepeatableRead => "REPEATABLE_READ",
                TransactionIsolation::ReadCommitted => "READ_COMMITTED",
                TransactionIsolation::ReadUncommitted => "READ_UNCOMMITTED",
                TransactionIsolation::Serializable => "SERIALIZABLE",
                TransactionIsolation::ConsistentSnapshotReadOnly => {
                    "CONSISTENT_SNAPSHOT_READ_ONLY"
                }
                TransactionIsolation::Autocommit => "AUTOCOMMIT",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "DEFAULT" => Some(Self::Default),
                "REPEATABLE_READ" => Some(Self::RepeatableRead),
                "READ_COMMITTED" => Some(Self::ReadCommitted),
                "READ_UNCOMMITTED" => Some(Self::ReadUncommitted),
                "SERIALIZABLE" => Some(Self::Serializable),
                "CONSISTENT_SNAPSHOT_READ_ONLY" => Some(Self::ConsistentSnapshotReadOnly),
                "AUTOCOMMIT" => Some(Self::Autocommit),
                _ => None,
            }
        }
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum PlannerVersion {
        DefaultPlanner = 0,
        V3 = 1,
        Gen4 = 2,
        Gen4Greedy = 3,
        Gen4Left2Right = 4,
        Gen4WithFallback = 5,
        Gen4CompareV3 = 6,
    }
    impl PlannerVersion {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                PlannerVersion::DefaultPlanner => "DEFAULT_PLANNER",
                PlannerVersion::V3 => "V3",
                PlannerVersion::Gen4 => "Gen4",
                PlannerVersion::Gen4Greedy => "Gen4Greedy",
                PlannerVersion::Gen4Left2Right => "Gen4Left2Right",
                PlannerVersion::Gen4WithFallback => "Gen4WithFallback",
                PlannerVersion::Gen4CompareV3 => "Gen4CompareV3",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "DEFAULT_PLANNER" => Some(Self::DefaultPlanner),
                "V3" => Some(Self::V3),
                "Gen4" => Some(Self::Gen4),
                "Gen4Greedy" => Some(Self::Gen4Greedy),
                "Gen4Left2Right" => Some(Self::Gen4Left2Right),
                "Gen4WithFallback" => Some(Self::Gen4WithFallback),
                "Gen4CompareV3" => Some(Self::Gen4CompareV3),
                _ => None,
            }
        }
    }
}
/// Field describes a single column returned by a query
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Field {
    /// name of the field as returned by mysql C API
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// vitess-defined type. Conversion function is in sqltypes package.
    #[prost(enumeration = "Type", tag = "2")]
    pub r#type: i32,
    /// Remaining fields from mysql C API.
    /// These fields are only populated when ExecuteOptions.included_fields
    /// is set to IncludedFields.ALL.
    #[prost(string, tag = "3")]
    pub table: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub org_table: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub database: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub org_name: ::prost::alloc::string::String,
    /// column_length is really a uint32. All 32 bits can be used.
    #[prost(uint32, tag = "7")]
    pub column_length: u32,
    /// charset is actually a uint16. Only the lower 16 bits are used.
    #[prost(uint32, tag = "8")]
    pub charset: u32,
    /// decimals is actually a uint8. Only the lower 8 bits are used.
    #[prost(uint32, tag = "9")]
    pub decimals: u32,
    /// flags is actually a uint16. Only the lower 16 bits are used.
    #[prost(uint32, tag = "10")]
    pub flags: u32,
    /// column_type is optionally populated from information_schema.columns
    #[prost(string, tag = "11")]
    pub column_type: ::prost::alloc::string::String,
}
/// Row is a database row.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Row {
    /// lengths contains the length of each value in values.
    /// A length of -1 means that the field is NULL. While
    /// reading values, you have to accummulate the length
    /// to know the offset where the next value begins in values.
    #[prost(sint64, repeated, tag = "1")]
    pub lengths: ::prost::alloc::vec::Vec<i64>,
    /// values contains a concatenation of all values in the row.
    #[prost(bytes = "vec", tag = "2")]
    pub values: ::prost::alloc::vec::Vec<u8>,
}
/// QueryResult is returned by Execute and ExecuteStream.
///
/// As returned by Execute, len(fields) is always equal to len(row)
/// (for each row in rows).
///
/// As returned by StreamExecute, the first QueryResult has the fields
/// set, and subsequent QueryResult have rows set. And as Execute,
/// len(QueryResult\[0\].fields) is always equal to len(row) (for each
/// row in rows for each QueryResult in QueryResult\[1:\]).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResult {
    #[prost(message, repeated, tag = "1")]
    pub fields: ::prost::alloc::vec::Vec<Field>,
    #[prost(uint64, tag = "2")]
    pub rows_affected: u64,
    #[prost(uint64, tag = "3")]
    pub insert_id: u64,
    #[prost(message, repeated, tag = "4")]
    pub rows: ::prost::alloc::vec::Vec<Row>,
    #[prost(string, tag = "6")]
    pub info: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub session_state_changes: ::prost::alloc::string::String,
}
/// QueryWarning is used to convey out of band query execution warnings
/// by storing in the vtgate.Session
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryWarning {
    #[prost(uint32, tag = "1")]
    pub code: u32,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
}
/// StreamEvent describes a set of transformations that happened as a
/// single transactional unit on a server. It is streamed back by the
/// Update Stream calls.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamEvent {
    /// The statements in this transaction.
    #[prost(message, repeated, tag = "1")]
    pub statements: ::prost::alloc::vec::Vec<stream_event::Statement>,
    /// The Event Token for this event.
    #[prost(message, optional, tag = "2")]
    pub event_token: ::core::option::Option<EventToken>,
}
/// Nested message and enum types in `StreamEvent`.
pub mod stream_event {
    /// One individual Statement in a transaction.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Statement {
        #[prost(enumeration = "statement::Category", tag = "1")]
        pub category: i32,
        /// table_name, primary_key_fields and primary_key_values are set for DML.
        #[prost(string, tag = "2")]
        pub table_name: ::prost::alloc::string::String,
        #[prost(message, repeated, tag = "3")]
        pub primary_key_fields: ::prost::alloc::vec::Vec<super::Field>,
        #[prost(message, repeated, tag = "4")]
        pub primary_key_values: ::prost::alloc::vec::Vec<super::Row>,
        /// sql is set for all queries.
        /// FIXME(alainjobart) we may not need it for DMLs.
        #[prost(bytes = "vec", tag = "5")]
        pub sql: ::prost::alloc::vec::Vec<u8>,
    }
    /// Nested message and enum types in `Statement`.
    pub mod statement {
        /// The category of one statement.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum Category {
            Error = 0,
            Dml = 1,
            Ddl = 2,
        }
        impl Category {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    Category::Error => "Error",
                    Category::Dml => "DML",
                    Category::Ddl => "DDL",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "Error" => Some(Self::Error),
                    "DML" => Some(Self::Dml),
                    "DDL" => Some(Self::Ddl),
                    _ => None,
                }
            }
        }
    }
}
/// ExecuteRequest is the payload to Execute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "4")]
    pub query: ::core::option::Option<BoundQuery>,
    #[prost(int64, tag = "5")]
    pub transaction_id: i64,
    #[prost(message, optional, tag = "6")]
    pub options: ::core::option::Option<ExecuteOptions>,
    #[prost(int64, tag = "7")]
    pub reserved_id: i64,
}
/// ExecuteResponse is the returned value from Execute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteResponse {
    #[prost(message, optional, tag = "1")]
    pub result: ::core::option::Option<QueryResult>,
}
/// ResultWithError represents a query response
/// in the form of result or error but not both.
/// TODO: To be used in ExecuteBatchResponse and BeginExecuteBatchResponse.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResultWithError {
    /// error contains an query level error, only set if result is unset.
    #[prost(message, optional, tag = "1")]
    pub error: ::core::option::Option<super::vtrpc::RpcError>,
    /// result contains the query result, only set if error is unset.
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<QueryResult>,
}
/// StreamExecuteRequest is the payload to StreamExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamExecuteRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "4")]
    pub query: ::core::option::Option<BoundQuery>,
    #[prost(message, optional, tag = "5")]
    pub options: ::core::option::Option<ExecuteOptions>,
    #[prost(int64, tag = "6")]
    pub transaction_id: i64,
    #[prost(int64, tag = "7")]
    pub reserved_id: i64,
}
/// StreamExecuteResponse is the returned value from StreamExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamExecuteResponse {
    #[prost(message, optional, tag = "1")]
    pub result: ::core::option::Option<QueryResult>,
}
/// BeginRequest is the payload to Begin
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BeginRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "4")]
    pub options: ::core::option::Option<ExecuteOptions>,
}
/// BeginResponse is the returned value from Begin
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BeginResponse {
    #[prost(int64, tag = "1")]
    pub transaction_id: i64,
    #[prost(message, optional, tag = "2")]
    pub tablet_alias: ::core::option::Option<super::topodata::TabletAlias>,
    /// The session_state_changes might be set if the transaction is a snapshot transaction
    /// and the MySQL implementation supports getting a start gtid on snapshot
    #[prost(string, tag = "3")]
    pub session_state_changes: ::prost::alloc::string::String,
}
/// CommitRequest is the payload to Commit
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommitRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(int64, tag = "4")]
    pub transaction_id: i64,
}
/// CommitResponse is the returned value from Commit
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommitResponse {
    #[prost(int64, tag = "1")]
    pub reserved_id: i64,
}
/// RollbackRequest is the payload to Rollback
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RollbackRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(int64, tag = "4")]
    pub transaction_id: i64,
}
/// RollbackResponse is the returned value from Rollback
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RollbackResponse {
    #[prost(int64, tag = "1")]
    pub reserved_id: i64,
}
/// PrepareRequest is the payload to Prepare
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PrepareRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(int64, tag = "4")]
    pub transaction_id: i64,
    #[prost(string, tag = "5")]
    pub dtid: ::prost::alloc::string::String,
}
/// PrepareResponse is the returned value from Prepare
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PrepareResponse {}
/// CommitPreparedRequest is the payload to CommitPrepared
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommitPreparedRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(string, tag = "4")]
    pub dtid: ::prost::alloc::string::String,
}
/// CommitPreparedResponse is the returned value from CommitPrepared
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommitPreparedResponse {}
/// RollbackPreparedRequest is the payload to RollbackPrepared
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RollbackPreparedRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(int64, tag = "4")]
    pub transaction_id: i64,
    #[prost(string, tag = "5")]
    pub dtid: ::prost::alloc::string::String,
}
/// RollbackPreparedResponse is the returned value from RollbackPrepared
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RollbackPreparedResponse {}
/// CreateTransactionRequest is the payload to CreateTransaction
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTransactionRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(string, tag = "4")]
    pub dtid: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "5")]
    pub participants: ::prost::alloc::vec::Vec<Target>,
}
/// CreateTransactionResponse is the returned value from CreateTransaction
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTransactionResponse {}
/// StartCommitRequest is the payload to StartCommit
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartCommitRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(int64, tag = "4")]
    pub transaction_id: i64,
    #[prost(string, tag = "5")]
    pub dtid: ::prost::alloc::string::String,
}
/// StartCommitResponse is the returned value from StartCommit
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartCommitResponse {}
/// SetRollbackRequest is the payload to SetRollback
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetRollbackRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(int64, tag = "4")]
    pub transaction_id: i64,
    #[prost(string, tag = "5")]
    pub dtid: ::prost::alloc::string::String,
}
/// SetRollbackResponse is the returned value from SetRollback
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetRollbackResponse {}
/// ConcludeTransactionRequest is the payload to ConcludeTransaction
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConcludeTransactionRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(string, tag = "4")]
    pub dtid: ::prost::alloc::string::String,
}
/// ConcludeTransactionResponse is the returned value from ConcludeTransaction
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConcludeTransactionResponse {}
/// ReadTransactionRequest is the payload to ReadTransaction
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadTransactionRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(string, tag = "4")]
    pub dtid: ::prost::alloc::string::String,
}
/// ReadTransactionResponse is the returned value from ReadTransaction
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadTransactionResponse {
    #[prost(message, optional, tag = "1")]
    pub metadata: ::core::option::Option<TransactionMetadata>,
}
/// BeginExecuteRequest is the payload to BeginExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BeginExecuteRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "4")]
    pub query: ::core::option::Option<BoundQuery>,
    #[prost(message, optional, tag = "5")]
    pub options: ::core::option::Option<ExecuteOptions>,
    #[prost(int64, tag = "6")]
    pub reserved_id: i64,
    #[prost(string, repeated, tag = "7")]
    pub pre_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// BeginExecuteResponse is the returned value from BeginExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BeginExecuteResponse {
    /// error contains an application level error if necessary. Note the
    /// transaction_id may be set, even when an error is returned, if the begin
    /// worked but the execute failed.
    #[prost(message, optional, tag = "1")]
    pub error: ::core::option::Option<super::vtrpc::RpcError>,
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<QueryResult>,
    /// transaction_id might be non-zero even if an error is present.
    #[prost(int64, tag = "3")]
    pub transaction_id: i64,
    #[prost(message, optional, tag = "4")]
    pub tablet_alias: ::core::option::Option<super::topodata::TabletAlias>,
    /// The session_state_changes might be set if the transaction is a snapshot transaction
    /// and the MySQL implementation supports getting a start gtid on snapshot
    #[prost(string, tag = "5")]
    pub session_state_changes: ::prost::alloc::string::String,
}
/// BeginStreamExecuteRequest is the payload to BeginStreamExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BeginStreamExecuteRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "4")]
    pub query: ::core::option::Option<BoundQuery>,
    #[prost(message, optional, tag = "5")]
    pub options: ::core::option::Option<ExecuteOptions>,
    #[prost(string, repeated, tag = "6")]
    pub pre_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(int64, tag = "7")]
    pub reserved_id: i64,
}
/// BeginStreamExecuteResponse is the returned value from BeginStreamExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BeginStreamExecuteResponse {
    /// error contains an application level error if necessary. Note the
    /// transaction_id may be set, even when an error is returned, if the begin
    /// worked but the stream execute failed.
    #[prost(message, optional, tag = "1")]
    pub error: ::core::option::Option<super::vtrpc::RpcError>,
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<QueryResult>,
    /// transaction_id might be non-zero even if an error is present.
    #[prost(int64, tag = "3")]
    pub transaction_id: i64,
    #[prost(message, optional, tag = "4")]
    pub tablet_alias: ::core::option::Option<super::topodata::TabletAlias>,
    /// The session_state_changes might be set if the transaction is a snapshot transaction
    /// and the MySQL implementation supports getting a start gtid on snapshot
    #[prost(string, tag = "5")]
    pub session_state_changes: ::prost::alloc::string::String,
}
/// MessageStreamRequest is the request payload for MessageStream.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageStreamRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    /// name is the message table name.
    #[prost(string, tag = "4")]
    pub name: ::prost::alloc::string::String,
}
/// MessageStreamResponse is a response for MessageStream.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageStreamResponse {
    #[prost(message, optional, tag = "1")]
    pub result: ::core::option::Option<QueryResult>,
}
/// MessageAckRequest is the request payload for MessageAck.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageAckRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    /// name is the message table name.
    #[prost(string, tag = "4")]
    pub name: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "5")]
    pub ids: ::prost::alloc::vec::Vec<Value>,
}
/// MessageAckResponse is the response for MessageAck.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageAckResponse {
    /// result contains the result of the ack operation.
    /// Since this acts like a DML, only
    /// RowsAffected is returned in the result.
    #[prost(message, optional, tag = "1")]
    pub result: ::core::option::Option<QueryResult>,
}
/// ReserveExecuteRequest is the payload to ReserveExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReserveExecuteRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "4")]
    pub query: ::core::option::Option<BoundQuery>,
    #[prost(int64, tag = "5")]
    pub transaction_id: i64,
    #[prost(message, optional, tag = "6")]
    pub options: ::core::option::Option<ExecuteOptions>,
    #[prost(string, repeated, tag = "7")]
    pub pre_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// ReserveExecuteResponse is the returned value from ReserveExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReserveExecuteResponse {
    #[prost(message, optional, tag = "1")]
    pub error: ::core::option::Option<super::vtrpc::RpcError>,
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<QueryResult>,
    /// The following fields might be non-zero even if an error is present.
    #[prost(int64, tag = "3")]
    pub reserved_id: i64,
    #[prost(message, optional, tag = "4")]
    pub tablet_alias: ::core::option::Option<super::topodata::TabletAlias>,
}
/// ReserveStreamExecuteRequest is the payload to ReserveStreamExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReserveStreamExecuteRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "4")]
    pub query: ::core::option::Option<BoundQuery>,
    #[prost(message, optional, tag = "5")]
    pub options: ::core::option::Option<ExecuteOptions>,
    #[prost(int64, tag = "6")]
    pub transaction_id: i64,
    #[prost(string, repeated, tag = "7")]
    pub pre_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// ReserveStreamExecuteResponse is the returned value from ReserveStreamExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReserveStreamExecuteResponse {
    #[prost(message, optional, tag = "1")]
    pub error: ::core::option::Option<super::vtrpc::RpcError>,
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<QueryResult>,
    /// The following fields might be non-zero even if an error is present.
    #[prost(int64, tag = "3")]
    pub reserved_id: i64,
    #[prost(message, optional, tag = "4")]
    pub tablet_alias: ::core::option::Option<super::topodata::TabletAlias>,
}
/// ReserveBeginExecuteRequest is the payload to ReserveBeginExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReserveBeginExecuteRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "4")]
    pub query: ::core::option::Option<BoundQuery>,
    #[prost(message, optional, tag = "5")]
    pub options: ::core::option::Option<ExecuteOptions>,
    #[prost(string, repeated, tag = "6")]
    pub pre_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "7")]
    pub post_begin_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// ReserveBeginExecuteResponse is the returned value from ReserveBeginExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReserveBeginExecuteResponse {
    /// error contains an application level error if necessary. Note the
    /// transaction_id may be set, even when an error is returned, if the begin
    /// worked but the execute failed.
    #[prost(message, optional, tag = "1")]
    pub error: ::core::option::Option<super::vtrpc::RpcError>,
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<QueryResult>,
    /// The following fields might be non-zero even if an error is present.
    #[prost(int64, tag = "3")]
    pub transaction_id: i64,
    #[prost(int64, tag = "4")]
    pub reserved_id: i64,
    #[prost(message, optional, tag = "5")]
    pub tablet_alias: ::core::option::Option<super::topodata::TabletAlias>,
    /// The session_state_changes might be set if the transaction is a snapshot transaction
    /// and the MySQL implementation supports getting a start gtid on snapshot
    #[prost(string, tag = "6")]
    pub session_state_changes: ::prost::alloc::string::String,
}
/// ReserveBeginStreamExecuteRequest is the payload to ReserveBeginStreamExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReserveBeginStreamExecuteRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "4")]
    pub query: ::core::option::Option<BoundQuery>,
    #[prost(message, optional, tag = "5")]
    pub options: ::core::option::Option<ExecuteOptions>,
    #[prost(string, repeated, tag = "6")]
    pub pre_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "7")]
    pub post_begin_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// ReserveBeginStreamExecuteResponse is the returned value from ReserveBeginStreamExecute
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReserveBeginStreamExecuteResponse {
    /// error contains an application level error if necessary. Note the
    /// transaction_id may be set, even when an error is returned, if the begin
    /// worked but the stream execute failed.
    #[prost(message, optional, tag = "1")]
    pub error: ::core::option::Option<super::vtrpc::RpcError>,
    #[prost(message, optional, tag = "2")]
    pub result: ::core::option::Option<QueryResult>,
    /// The following fields might be non-zero even if an error is present.
    #[prost(int64, tag = "3")]
    pub transaction_id: i64,
    #[prost(int64, tag = "4")]
    pub reserved_id: i64,
    #[prost(message, optional, tag = "5")]
    pub tablet_alias: ::core::option::Option<super::topodata::TabletAlias>,
    /// The session_state_changes might be set if the transaction is a snapshot transaction
    /// and the MySQL implementation supports getting a start gtid on snapshot
    #[prost(string, tag = "6")]
    pub session_state_changes: ::prost::alloc::string::String,
}
/// ReleaseRequest is the payload to Release
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReleaseRequest {
    #[prost(message, optional, tag = "1")]
    pub effective_caller_id: ::core::option::Option<super::vtrpc::CallerId>,
    #[prost(message, optional, tag = "2")]
    pub immediate_caller_id: ::core::option::Option<VtGateCallerId>,
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<Target>,
    #[prost(int64, tag = "4")]
    pub transaction_id: i64,
    #[prost(int64, tag = "5")]
    pub reserved_id: i64,
}
/// ReleaseResponse is the returned value from Release
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReleaseResponse {}
/// StreamHealthRequest is the payload for StreamHealth
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamHealthRequest {}
/// RealtimeStats contains information about the tablet status.
/// It is only valid for a single tablet.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RealtimeStats {
    /// health_error is the last error we got from health check,
    /// or empty is the server is healthy. This is used for subset selection,
    /// we do not send queries to servers that are not healthy.
    #[prost(string, tag = "1")]
    pub health_error: ::prost::alloc::string::String,
    /// replication_lag_seconds is populated for replicas only. It indicates
    /// how far behind on (MySQL) replication a replica currently is.  It is used
    /// by clients for subset selection (so we don't try to send traffic
    /// to tablets that are too far behind).
    /// NOTE: This field must not be evaluated if "health_error" is not empty.
    /// TODO(mberlin): Let's switch it to int64 instead?
    #[prost(uint32, tag = "2")]
    pub replication_lag_seconds: u32,
    /// bin_log_players_count is the number of currently running binlog players.
    /// if the value is 0, it means that filtered replication is currently not
    /// running on the tablet. If >0, filtered replication is running.
    /// NOTE: This field must not be evaluated if "health_error" is not empty.
    #[prost(int32, tag = "3")]
    pub binlog_players_count: i32,
    /// filtered_replication_lag_seconds is populated for the receiving
    /// primary of an ongoing filtered replication only.
    /// It specifies how far the receiving primary lags behind the sending primary.
    /// NOTE: This field must not be evaluated if "health_error" is not empty.
    /// NOTE: This field must not be evaluated if "bin_log_players_count" is 0.
    #[prost(int64, tag = "4")]
    pub filtered_replication_lag_seconds: i64,
    /// cpu_usage is used for load-based balancing
    #[prost(double, tag = "5")]
    pub cpu_usage: f64,
    /// qps is the average QPS (queries per second) rate in the last XX seconds
    /// where XX is usually 60 (See query_service_stats.go).
    #[prost(double, tag = "6")]
    pub qps: f64,
    /// table_schema_changed is to provide list of tables that have schema changes detected by the tablet.
    #[prost(string, repeated, tag = "7")]
    pub table_schema_changed: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// AggregateStats contains information about the health of a group of
/// tablets for a Target.  It is used to propagate stats from a vtgate
/// to another, or from the Gateway layer of a vtgate to the routing
/// layer.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AggregateStats {
    /// healthy_tablet_count is the number of healthy tablets in the group.
    #[prost(int32, tag = "1")]
    pub healthy_tablet_count: i32,
    /// unhealthy_tablet_count is the number of unhealthy tablets in the group.
    #[prost(int32, tag = "2")]
    pub unhealthy_tablet_count: i32,
    /// replication_lag_seconds_min is the minimum of the
    /// replication_lag_seconds values of the healthy tablets. It is unset
    /// if the tablet type is primary.
    #[prost(uint32, tag = "3")]
    pub replication_lag_seconds_min: u32,
    /// replication_lag_seconds_max is the maximum of the
    /// replication_lag_seconds values of the healthy tablets. It is unset
    /// if the tablet type is primary.
    #[prost(uint32, tag = "4")]
    pub replication_lag_seconds_max: u32,
}
/// StreamHealthResponse is streamed by StreamHealth on a regular basis.
/// It is expected to be used between a vtgate and vttablet:
/// - target describes the tablet.
/// - realtime_stats is set.
/// - aggregate_stats is not set (deprecated)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamHealthResponse {
    /// target is the current server type. Only queries with that exact Target
    /// record will be accepted (the cell may not match, however).
    #[prost(message, optional, tag = "1")]
    pub target: ::core::option::Option<Target>,
    /// serving is true iff the tablet is serving. A tablet may not be serving
    /// if filtered replication is enabled on a primary for instance,
    /// or if a replica should not be used because the keyspace is being resharded.
    #[prost(bool, tag = "2")]
    pub serving: bool,
    /// tablet_externally_reparented_timestamp can be interpreted as the
    /// last time we knew that this tablet was the PRIMARY of this shard
    /// (if StreamHealthResponse describes a group of tablets, between
    /// two vtgates, only one primary will be present in the group, and
    /// this is this primary's value).
    ///
    /// It is used by vtgate when determining the current PRIMARY of a shard.
    /// If vtgate sees more than one PRIMARY tablet, this timestamp is used
    /// as tiebreaker where the PRIMARY with the highest timestamp wins.
    /// Another usage of this timestamp is in go/vt/vtgate/buffer to detect the end
    /// of a reparent (failover) and stop buffering.
    ///
    /// In practice, this field is set to:
    /// a) the last time the RPC tabletmanager.TabletExternallyReparented was
    ///     called on this tablet (usually done by an external failover tool e.g.
    ///     Orchestrator). The failover tool can call this as long as we are the
    ///     primary i.e. even ages after the last reparent occurred.
    /// OR
    /// b) the last time an active reparent was executed through a vtctl command
    ///     (InitShardPrimary, PlannedReparentShard, EmergencyReparentShard)
    /// OR
    /// c) the last time vttablet was started and it initialized its tablet type
    ///     as PRIMARY because it was recorded as the shard's current primary in the
    ///     topology (see go/vt/vttablet/tabletmanager/init_tablet.go)
    /// OR
    /// d) 0 if the vttablet was never a PRIMARY.
    #[prost(int64, tag = "3")]
    pub tablet_externally_reparented_timestamp: i64,
    /// realtime_stats contains information about the tablet status.
    /// It is only filled in if the information is about a tablet.
    #[prost(message, optional, tag = "4")]
    pub realtime_stats: ::core::option::Option<RealtimeStats>,
    /// tablet_alias is the alias of the sending tablet. The discovery/healthcheck.go
    /// code uses it to verify that it's talking to the correct tablet and that it
    /// hasn't changed in the meantime e.g. due to tablet restarts where ports or
    /// ips have been reused but assigned differently.
    #[prost(message, optional, tag = "5")]
    pub tablet_alias: ::core::option::Option<super::topodata::TabletAlias>,
}
/// TransactionMetadata contains the metadata for a distributed transaction.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionMetadata {
    #[prost(string, tag = "1")]
    pub dtid: ::prost::alloc::string::String,
    #[prost(enumeration = "TransactionState", tag = "2")]
    pub state: i32,
    #[prost(int64, tag = "3")]
    pub time_created: i64,
    #[prost(message, repeated, tag = "4")]
    pub participants: ::prost::alloc::vec::Vec<Target>,
}
/// Flags sent from the MySQL C API
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MySqlFlag {
    Empty = 0,
    NotNullFlag = 1,
    PriKeyFlag = 2,
    UniqueKeyFlag = 4,
    MultipleKeyFlag = 8,
    BlobFlag = 16,
    UnsignedFlag = 32,
    ZerofillFlag = 64,
    BinaryFlag = 128,
    EnumFlag = 256,
    AutoIncrementFlag = 512,
    TimestampFlag = 1024,
    SetFlag = 2048,
    NoDefaultValueFlag = 4096,
    OnUpdateNowFlag = 8192,
    NumFlag = 32768,
    PartKeyFlag = 16384,
    UniqueFlag = 65536,
    BincmpFlag = 131072,
}
impl MySqlFlag {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            MySqlFlag::Empty => "EMPTY",
            MySqlFlag::NotNullFlag => "NOT_NULL_FLAG",
            MySqlFlag::PriKeyFlag => "PRI_KEY_FLAG",
            MySqlFlag::UniqueKeyFlag => "UNIQUE_KEY_FLAG",
            MySqlFlag::MultipleKeyFlag => "MULTIPLE_KEY_FLAG",
            MySqlFlag::BlobFlag => "BLOB_FLAG",
            MySqlFlag::UnsignedFlag => "UNSIGNED_FLAG",
            MySqlFlag::ZerofillFlag => "ZEROFILL_FLAG",
            MySqlFlag::BinaryFlag => "BINARY_FLAG",
            MySqlFlag::EnumFlag => "ENUM_FLAG",
            MySqlFlag::AutoIncrementFlag => "AUTO_INCREMENT_FLAG",
            MySqlFlag::TimestampFlag => "TIMESTAMP_FLAG",
            MySqlFlag::SetFlag => "SET_FLAG",
            MySqlFlag::NoDefaultValueFlag => "NO_DEFAULT_VALUE_FLAG",
            MySqlFlag::OnUpdateNowFlag => "ON_UPDATE_NOW_FLAG",
            MySqlFlag::NumFlag => "NUM_FLAG",
            MySqlFlag::PartKeyFlag => "PART_KEY_FLAG",
            MySqlFlag::UniqueFlag => "UNIQUE_FLAG",
            MySqlFlag::BincmpFlag => "BINCMP_FLAG",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "EMPTY" => Some(Self::Empty),
            "NOT_NULL_FLAG" => Some(Self::NotNullFlag),
            "PRI_KEY_FLAG" => Some(Self::PriKeyFlag),
            "UNIQUE_KEY_FLAG" => Some(Self::UniqueKeyFlag),
            "MULTIPLE_KEY_FLAG" => Some(Self::MultipleKeyFlag),
            "BLOB_FLAG" => Some(Self::BlobFlag),
            "UNSIGNED_FLAG" => Some(Self::UnsignedFlag),
            "ZEROFILL_FLAG" => Some(Self::ZerofillFlag),
            "BINARY_FLAG" => Some(Self::BinaryFlag),
            "ENUM_FLAG" => Some(Self::EnumFlag),
            "AUTO_INCREMENT_FLAG" => Some(Self::AutoIncrementFlag),
            "TIMESTAMP_FLAG" => Some(Self::TimestampFlag),
            "SET_FLAG" => Some(Self::SetFlag),
            "NO_DEFAULT_VALUE_FLAG" => Some(Self::NoDefaultValueFlag),
            "ON_UPDATE_NOW_FLAG" => Some(Self::OnUpdateNowFlag),
            "NUM_FLAG" => Some(Self::NumFlag),
            "PART_KEY_FLAG" => Some(Self::PartKeyFlag),
            "UNIQUE_FLAG" => Some(Self::UniqueFlag),
            "BINCMP_FLAG" => Some(Self::BincmpFlag),
            _ => None,
        }
    }
}
/// Flag allows us to qualify types by their common properties.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Flag {
    None = 0,
    Isintegral = 256,
    Isunsigned = 512,
    Isfloat = 1024,
    Isquoted = 2048,
    Istext = 4096,
    Isbinary = 8192,
}
impl Flag {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Flag::None => "NONE",
            Flag::Isintegral => "ISINTEGRAL",
            Flag::Isunsigned => "ISUNSIGNED",
            Flag::Isfloat => "ISFLOAT",
            Flag::Isquoted => "ISQUOTED",
            Flag::Istext => "ISTEXT",
            Flag::Isbinary => "ISBINARY",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "NONE" => Some(Self::None),
            "ISINTEGRAL" => Some(Self::Isintegral),
            "ISUNSIGNED" => Some(Self::Isunsigned),
            "ISFLOAT" => Some(Self::Isfloat),
            "ISQUOTED" => Some(Self::Isquoted),
            "ISTEXT" => Some(Self::Istext),
            "ISBINARY" => Some(Self::Isbinary),
            _ => None,
        }
    }
}
/// Type defines the various supported data types in bind vars
/// and query results.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Type {
    /// NULL_TYPE specifies a NULL type.
    NullType = 0,
    /// INT8 specifies a TINYINT type.
    /// Properties: 1, IsNumber.
    Int8 = 257,
    /// UINT8 specifies a TINYINT UNSIGNED type.
    /// Properties: 2, IsNumber, IsUnsigned.
    Uint8 = 770,
    /// INT16 specifies a SMALLINT type.
    /// Properties: 3, IsNumber.
    Int16 = 259,
    /// UINT16 specifies a SMALLINT UNSIGNED type.
    /// Properties: 4, IsNumber, IsUnsigned.
    Uint16 = 772,
    /// INT24 specifies a MEDIUMINT type.
    /// Properties: 5, IsNumber.
    Int24 = 261,
    /// UINT24 specifies a MEDIUMINT UNSIGNED type.
    /// Properties: 6, IsNumber, IsUnsigned.
    Uint24 = 774,
    /// INT32 specifies a INTEGER type.
    /// Properties: 7, IsNumber.
    Int32 = 263,
    /// UINT32 specifies a INTEGER UNSIGNED type.
    /// Properties: 8, IsNumber, IsUnsigned.
    Uint32 = 776,
    /// INT64 specifies a BIGINT type.
    /// Properties: 9, IsNumber.
    Int64 = 265,
    /// UINT64 specifies a BIGINT UNSIGNED type.
    /// Properties: 10, IsNumber, IsUnsigned.
    Uint64 = 778,
    /// FLOAT32 specifies a FLOAT type.
    /// Properties: 11, IsFloat.
    Float32 = 1035,
    /// FLOAT64 specifies a DOUBLE or REAL type.
    /// Properties: 12, IsFloat.
    Float64 = 1036,
    /// TIMESTAMP specifies a TIMESTAMP type.
    /// Properties: 13, IsQuoted.
    Timestamp = 2061,
    /// DATE specifies a DATE type.
    /// Properties: 14, IsQuoted.
    Date = 2062,
    /// TIME specifies a TIME type.
    /// Properties: 15, IsQuoted.
    Time = 2063,
    /// DATETIME specifies a DATETIME type.
    /// Properties: 16, IsQuoted.
    Datetime = 2064,
    /// YEAR specifies a YEAR type.
    /// Properties: 17, IsNumber, IsUnsigned.
    Year = 785,
    /// DECIMAL specifies a DECIMAL or NUMERIC type.
    /// Properties: 18, None.
    Decimal = 18,
    /// TEXT specifies a TEXT type.
    /// Properties: 19, IsQuoted, IsText.
    Text = 6163,
    /// BLOB specifies a BLOB type.
    /// Properties: 20, IsQuoted, IsBinary.
    Blob = 10260,
    /// VARCHAR specifies a VARCHAR type.
    /// Properties: 21, IsQuoted, IsText.
    Varchar = 6165,
    /// VARBINARY specifies a VARBINARY type.
    /// Properties: 22, IsQuoted, IsBinary.
    Varbinary = 10262,
    /// CHAR specifies a CHAR type.
    /// Properties: 23, IsQuoted, IsText.
    Char = 6167,
    /// BINARY specifies a BINARY type.
    /// Properties: 24, IsQuoted, IsBinary.
    Binary = 10264,
    /// BIT specifies a BIT type.
    /// Properties: 25, IsQuoted.
    Bit = 2073,
    /// ENUM specifies an ENUM type.
    /// Properties: 26, IsQuoted.
    Enum = 2074,
    /// SET specifies a SET type.
    /// Properties: 27, IsQuoted.
    Set = 2075,
    /// TUPLE specifies a tuple. This cannot
    /// be returned in a QueryResult, but it can
    /// be sent as a bind var.
    /// Properties: 28, None.
    Tuple = 28,
    /// GEOMETRY specifies a GEOMETRY type.
    /// Properties: 29, IsQuoted.
    Geometry = 2077,
    /// JSON specifies a JSON type.
    /// Properties: 30, IsQuoted.
    Json = 2078,
    /// EXPRESSION specifies a SQL expression.
    /// This type is for internal use only.
    /// Properties: 31, None.
    Expression = 31,
    /// HEXNUM specifies a HEXNUM type (unquoted varbinary).
    /// Properties: 32, IsText.
    Hexnum = 4128,
    /// HEXVAL specifies a HEXVAL type (unquoted varbinary).
    /// Properties: 33, IsText.
    Hexval = 4129,
    /// BITNUM specifies a base 2 binary type (unquoted varbinary).
    /// Properties: 34, IsText.
    Bitnum = 4130,
}
impl Type {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Type::NullType => "NULL_TYPE",
            Type::Int8 => "INT8",
            Type::Uint8 => "UINT8",
            Type::Int16 => "INT16",
            Type::Uint16 => "UINT16",
            Type::Int24 => "INT24",
            Type::Uint24 => "UINT24",
            Type::Int32 => "INT32",
            Type::Uint32 => "UINT32",
            Type::Int64 => "INT64",
            Type::Uint64 => "UINT64",
            Type::Float32 => "FLOAT32",
            Type::Float64 => "FLOAT64",
            Type::Timestamp => "TIMESTAMP",
            Type::Date => "DATE",
            Type::Time => "TIME",
            Type::Datetime => "DATETIME",
            Type::Year => "YEAR",
            Type::Decimal => "DECIMAL",
            Type::Text => "TEXT",
            Type::Blob => "BLOB",
            Type::Varchar => "VARCHAR",
            Type::Varbinary => "VARBINARY",
            Type::Char => "CHAR",
            Type::Binary => "BINARY",
            Type::Bit => "BIT",
            Type::Enum => "ENUM",
            Type::Set => "SET",
            Type::Tuple => "TUPLE",
            Type::Geometry => "GEOMETRY",
            Type::Json => "JSON",
            Type::Expression => "EXPRESSION",
            Type::Hexnum => "HEXNUM",
            Type::Hexval => "HEXVAL",
            Type::Bitnum => "BITNUM",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "NULL_TYPE" => Some(Self::NullType),
            "INT8" => Some(Self::Int8),
            "UINT8" => Some(Self::Uint8),
            "INT16" => Some(Self::Int16),
            "UINT16" => Some(Self::Uint16),
            "INT24" => Some(Self::Int24),
            "UINT24" => Some(Self::Uint24),
            "INT32" => Some(Self::Int32),
            "UINT32" => Some(Self::Uint32),
            "INT64" => Some(Self::Int64),
            "UINT64" => Some(Self::Uint64),
            "FLOAT32" => Some(Self::Float32),
            "FLOAT64" => Some(Self::Float64),
            "TIMESTAMP" => Some(Self::Timestamp),
            "DATE" => Some(Self::Date),
            "TIME" => Some(Self::Time),
            "DATETIME" => Some(Self::Datetime),
            "YEAR" => Some(Self::Year),
            "DECIMAL" => Some(Self::Decimal),
            "TEXT" => Some(Self::Text),
            "BLOB" => Some(Self::Blob),
            "VARCHAR" => Some(Self::Varchar),
            "VARBINARY" => Some(Self::Varbinary),
            "CHAR" => Some(Self::Char),
            "BINARY" => Some(Self::Binary),
            "BIT" => Some(Self::Bit),
            "ENUM" => Some(Self::Enum),
            "SET" => Some(Self::Set),
            "TUPLE" => Some(Self::Tuple),
            "GEOMETRY" => Some(Self::Geometry),
            "JSON" => Some(Self::Json),
            "EXPRESSION" => Some(Self::Expression),
            "HEXNUM" => Some(Self::Hexnum),
            "HEXVAL" => Some(Self::Hexval),
            "BITNUM" => Some(Self::Bitnum),
            _ => None,
        }
    }
}
/// TransactionState represents the state of a distributed transaction.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TransactionState {
    Unknown = 0,
    Prepare = 1,
    Commit = 2,
    Rollback = 3,
}
impl TransactionState {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            TransactionState::Unknown => "UNKNOWN",
            TransactionState::Prepare => "PREPARE",
            TransactionState::Commit => "COMMIT",
            TransactionState::Rollback => "ROLLBACK",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UNKNOWN" => Some(Self::Unknown),
            "PREPARE" => Some(Self::Prepare),
            "COMMIT" => Some(Self::Commit),
            "ROLLBACK" => Some(Self::Rollback),
            _ => None,
        }
    }
}