#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Charset {
#[prost(int32, tag = "1")]
pub client: i32,
#[prost(int32, tag = "2")]
pub conn: i32,
#[prost(int32, tag = "3")]
pub server: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BinlogTransaction {
#[prost(message, repeated, tag = "1")]
pub statements: ::prost::alloc::vec::Vec<binlog_transaction::Statement>,
#[prost(message, optional, tag = "4")]
pub event_token: ::core::option::Option<super::query::EventToken>,
}
pub mod binlog_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,
#[prost(message, optional, tag = "2")]
pub charset: ::core::option::Option<super::Charset>,
#[prost(bytes = "vec", tag = "3")]
pub sql: ::prost::alloc::vec::Vec<u8>,
}
pub mod statement {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Category {
BlUnrecognized = 0,
BlBegin = 1,
BlCommit = 2,
BlRollback = 3,
BlDmlDeprecated = 4,
BlDdl = 5,
BlSet = 6,
BlInsert = 7,
BlUpdate = 8,
BlDelete = 9,
}
impl Category {
pub fn as_str_name(&self) -> &'static str {
match self {
Category::BlUnrecognized => "BL_UNRECOGNIZED",
Category::BlBegin => "BL_BEGIN",
Category::BlCommit => "BL_COMMIT",
Category::BlRollback => "BL_ROLLBACK",
Category::BlDmlDeprecated => "BL_DML_DEPRECATED",
Category::BlDdl => "BL_DDL",
Category::BlSet => "BL_SET",
Category::BlInsert => "BL_INSERT",
Category::BlUpdate => "BL_UPDATE",
Category::BlDelete => "BL_DELETE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BL_UNRECOGNIZED" => Some(Self::BlUnrecognized),
"BL_BEGIN" => Some(Self::BlBegin),
"BL_COMMIT" => Some(Self::BlCommit),
"BL_ROLLBACK" => Some(Self::BlRollback),
"BL_DML_DEPRECATED" => Some(Self::BlDmlDeprecated),
"BL_DDL" => Some(Self::BlDdl),
"BL_SET" => Some(Self::BlSet),
"BL_INSERT" => Some(Self::BlInsert),
"BL_UPDATE" => Some(Self::BlUpdate),
"BL_DELETE" => Some(Self::BlDelete),
_ => None,
}
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamKeyRangeRequest {
#[prost(string, tag = "1")]
pub position: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub key_range: ::core::option::Option<super::topodata::KeyRange>,
#[prost(message, optional, tag = "3")]
pub charset: ::core::option::Option<Charset>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamKeyRangeResponse {
#[prost(message, optional, tag = "1")]
pub binlog_transaction: ::core::option::Option<BinlogTransaction>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamTablesRequest {
#[prost(string, tag = "1")]
pub position: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub charset: ::core::option::Option<Charset>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamTablesResponse {
#[prost(message, optional, tag = "1")]
pub binlog_transaction: ::core::option::Option<BinlogTransaction>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CharsetConversion {
#[prost(string, tag = "1")]
pub from_charset: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub to_charset: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Rule {
#[prost(string, tag = "1")]
pub r#match: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub filter: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub convert_enum_to_text: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(map = "string, message", tag = "4")]
pub convert_charset: ::std::collections::HashMap<
::prost::alloc::string::String,
CharsetConversion,
>,
#[prost(string, tag = "5")]
pub source_unique_key_columns: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub target_unique_key_columns: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub source_unique_key_target_columns: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Filter {
#[prost(message, repeated, tag = "1")]
pub rules: ::prost::alloc::vec::Vec<Rule>,
#[prost(enumeration = "filter::FieldEventMode", tag = "2")]
pub field_event_mode: i32,
#[prost(int64, tag = "3")]
pub workflow_type: i64,
#[prost(string, tag = "4")]
pub workflow_name: ::prost::alloc::string::String,
}
pub mod filter {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum FieldEventMode {
ErrOnMismatch = 0,
BestEffort = 1,
}
impl FieldEventMode {
pub fn as_str_name(&self) -> &'static str {
match self {
FieldEventMode::ErrOnMismatch => "ERR_ON_MISMATCH",
FieldEventMode::BestEffort => "BEST_EFFORT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ERR_ON_MISMATCH" => Some(Self::ErrOnMismatch),
"BEST_EFFORT" => Some(Self::BestEffort),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BinlogSource {
#[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,
#[prost(message, optional, tag = "4")]
pub key_range: ::core::option::Option<super::topodata::KeyRange>,
#[prost(string, repeated, tag = "5")]
pub tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub filter: ::core::option::Option<Filter>,
#[prost(enumeration = "OnDdlAction", tag = "7")]
pub on_ddl: i32,
#[prost(string, tag = "8")]
pub external_mysql: ::prost::alloc::string::String,
#[prost(bool, tag = "9")]
pub stop_after_copy: bool,
#[prost(string, tag = "10")]
pub external_cluster: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub source_time_zone: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub target_time_zone: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RowChange {
#[prost(message, optional, tag = "1")]
pub before: ::core::option::Option<super::query::Row>,
#[prost(message, optional, tag = "2")]
pub after: ::core::option::Option<super::query::Row>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RowEvent {
#[prost(string, tag = "1")]
pub table_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub row_changes: ::prost::alloc::vec::Vec<RowChange>,
#[prost(string, tag = "3")]
pub keyspace: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub shard: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldEvent {
#[prost(string, tag = "1")]
pub table_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
#[prost(string, tag = "3")]
pub keyspace: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub shard: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShardGtid {
#[prost(string, tag = "1")]
pub keyspace: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub shard: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub gtid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub table_p_ks: ::prost::alloc::vec::Vec<TableLastPk>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VGtid {
#[prost(message, repeated, tag = "1")]
pub shard_gtids: ::prost::alloc::vec::Vec<ShardGtid>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyspaceShard {
#[prost(string, tag = "1")]
pub keyspace: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub shard: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Journal {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(enumeration = "MigrationType", tag = "2")]
pub migration_type: i32,
#[prost(string, repeated, tag = "3")]
pub tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "4")]
pub local_position: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "5")]
pub shard_gtids: ::prost::alloc::vec::Vec<ShardGtid>,
#[prost(message, repeated, tag = "6")]
pub participants: ::prost::alloc::vec::Vec<KeyspaceShard>,
#[prost(string, repeated, tag = "7")]
pub source_workflows: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VEvent {
#[prost(enumeration = "VEventType", tag = "1")]
pub r#type: i32,
#[prost(int64, tag = "2")]
pub timestamp: i64,
#[prost(string, tag = "3")]
pub gtid: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub statement: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub row_event: ::core::option::Option<RowEvent>,
#[prost(message, optional, tag = "6")]
pub field_event: ::core::option::Option<FieldEvent>,
#[prost(message, optional, tag = "7")]
pub vgtid: ::core::option::Option<VGtid>,
#[prost(message, optional, tag = "8")]
pub journal: ::core::option::Option<Journal>,
#[prost(string, tag = "9")]
pub dml: ::prost::alloc::string::String,
#[prost(int64, tag = "20")]
pub current_time: i64,
#[prost(message, optional, tag = "21")]
pub last_p_k_event: ::core::option::Option<LastPkEvent>,
#[prost(string, tag = "22")]
pub keyspace: ::prost::alloc::string::String,
#[prost(string, tag = "23")]
pub shard: ::prost::alloc::string::String,
#[prost(bool, tag = "24")]
pub throttled: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MinimalTable {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
#[prost(int64, repeated, tag = "3")]
pub p_k_columns: ::prost::alloc::vec::Vec<i64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MinimalSchema {
#[prost(message, repeated, tag = "1")]
pub tables: ::prost::alloc::vec::Vec<MinimalTable>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VStreamRequest {
#[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<super::query::VtGateCallerId>,
#[prost(message, optional, tag = "3")]
pub target: ::core::option::Option<super::query::Target>,
#[prost(string, tag = "4")]
pub position: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub filter: ::core::option::Option<Filter>,
#[prost(message, repeated, tag = "6")]
pub table_last_p_ks: ::prost::alloc::vec::Vec<TableLastPk>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VStreamResponse {
#[prost(message, repeated, tag = "1")]
pub events: ::prost::alloc::vec::Vec<VEvent>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VStreamRowsRequest {
#[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<super::query::VtGateCallerId>,
#[prost(message, optional, tag = "3")]
pub target: ::core::option::Option<super::query::Target>,
#[prost(string, tag = "4")]
pub query: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub lastpk: ::core::option::Option<super::query::QueryResult>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VStreamRowsResponse {
#[prost(message, repeated, tag = "1")]
pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
#[prost(message, repeated, tag = "2")]
pub pkfields: ::prost::alloc::vec::Vec<super::query::Field>,
#[prost(string, tag = "3")]
pub gtid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub rows: ::prost::alloc::vec::Vec<super::query::Row>,
#[prost(message, optional, tag = "5")]
pub lastpk: ::core::option::Option<super::query::Row>,
#[prost(bool, tag = "6")]
pub throttled: bool,
#[prost(bool, tag = "7")]
pub heartbeat: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LastPkEvent {
#[prost(message, optional, tag = "1")]
pub table_last_p_k: ::core::option::Option<TableLastPk>,
#[prost(bool, tag = "2")]
pub completed: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableLastPk {
#[prost(string, tag = "1")]
pub table_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub lastpk: ::core::option::Option<super::query::QueryResult>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VStreamResultsRequest {
#[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<super::query::VtGateCallerId>,
#[prost(message, optional, tag = "3")]
pub target: ::core::option::Option<super::query::Target>,
#[prost(string, tag = "4")]
pub query: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VStreamResultsResponse {
#[prost(message, repeated, tag = "1")]
pub fields: ::prost::alloc::vec::Vec<super::query::Field>,
#[prost(string, tag = "3")]
pub gtid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub rows: ::prost::alloc::vec::Vec<super::query::Row>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OnDdlAction {
Ignore = 0,
Stop = 1,
Exec = 2,
ExecIgnore = 3,
}
impl OnDdlAction {
pub fn as_str_name(&self) -> &'static str {
match self {
OnDdlAction::Ignore => "IGNORE",
OnDdlAction::Stop => "STOP",
OnDdlAction::Exec => "EXEC",
OnDdlAction::ExecIgnore => "EXEC_IGNORE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"IGNORE" => Some(Self::Ignore),
"STOP" => Some(Self::Stop),
"EXEC" => Some(Self::Exec),
"EXEC_IGNORE" => Some(Self::ExecIgnore),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VReplicationWorkflowType {
Materialize = 0,
MoveTables = 1,
CreateLookupIndex = 2,
Migrate = 3,
Reshard = 4,
OnlineDdl = 5,
}
impl VReplicationWorkflowType {
pub fn as_str_name(&self) -> &'static str {
match self {
VReplicationWorkflowType::Materialize => "Materialize",
VReplicationWorkflowType::MoveTables => "MoveTables",
VReplicationWorkflowType::CreateLookupIndex => "CreateLookupIndex",
VReplicationWorkflowType::Migrate => "Migrate",
VReplicationWorkflowType::Reshard => "Reshard",
VReplicationWorkflowType::OnlineDdl => "OnlineDDL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Materialize" => Some(Self::Materialize),
"MoveTables" => Some(Self::MoveTables),
"CreateLookupIndex" => Some(Self::CreateLookupIndex),
"Migrate" => Some(Self::Migrate),
"Reshard" => Some(Self::Reshard),
"OnlineDDL" => Some(Self::OnlineDdl),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VReplicationWorkflowSubType {
None = 0,
Partial = 1,
}
impl VReplicationWorkflowSubType {
pub fn as_str_name(&self) -> &'static str {
match self {
VReplicationWorkflowSubType::None => "None",
VReplicationWorkflowSubType::Partial => "Partial",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"None" => Some(Self::None),
"Partial" => Some(Self::Partial),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VEventType {
Unknown = 0,
Gtid = 1,
Begin = 2,
Commit = 3,
Rollback = 4,
Ddl = 5,
Insert = 6,
Replace = 7,
Update = 8,
Delete = 9,
Set = 10,
Other = 11,
Row = 12,
Field = 13,
Heartbeat = 14,
Vgtid = 15,
Journal = 16,
Version = 17,
Lastpk = 18,
Savepoint = 19,
}
impl VEventType {
pub fn as_str_name(&self) -> &'static str {
match self {
VEventType::Unknown => "UNKNOWN",
VEventType::Gtid => "GTID",
VEventType::Begin => "BEGIN",
VEventType::Commit => "COMMIT",
VEventType::Rollback => "ROLLBACK",
VEventType::Ddl => "DDL",
VEventType::Insert => "INSERT",
VEventType::Replace => "REPLACE",
VEventType::Update => "UPDATE",
VEventType::Delete => "DELETE",
VEventType::Set => "SET",
VEventType::Other => "OTHER",
VEventType::Row => "ROW",
VEventType::Field => "FIELD",
VEventType::Heartbeat => "HEARTBEAT",
VEventType::Vgtid => "VGTID",
VEventType::Journal => "JOURNAL",
VEventType::Version => "VERSION",
VEventType::Lastpk => "LASTPK",
VEventType::Savepoint => "SAVEPOINT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"GTID" => Some(Self::Gtid),
"BEGIN" => Some(Self::Begin),
"COMMIT" => Some(Self::Commit),
"ROLLBACK" => Some(Self::Rollback),
"DDL" => Some(Self::Ddl),
"INSERT" => Some(Self::Insert),
"REPLACE" => Some(Self::Replace),
"UPDATE" => Some(Self::Update),
"DELETE" => Some(Self::Delete),
"SET" => Some(Self::Set),
"OTHER" => Some(Self::Other),
"ROW" => Some(Self::Row),
"FIELD" => Some(Self::Field),
"HEARTBEAT" => Some(Self::Heartbeat),
"VGTID" => Some(Self::Vgtid),
"JOURNAL" => Some(Self::Journal),
"VERSION" => Some(Self::Version),
"LASTPK" => Some(Self::Lastpk),
"SAVEPOINT" => Some(Self::Savepoint),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MigrationType {
Tables = 0,
Shards = 1,
}
impl MigrationType {
pub fn as_str_name(&self) -> &'static str {
match self {
MigrationType::Tables => "TABLES",
MigrationType::Shards => "SHARDS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TABLES" => Some(Self::Tables),
"SHARDS" => Some(Self::Shards),
_ => None,
}
}
}