1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct RoutingRules {
5 #[prost(message, repeated, tag = "1")]
9 pub rules: ::prost::alloc::vec::Vec<RoutingRule>,
10}
11#[allow(clippy::derive_partial_eq_without_eq)]
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct RoutingRule {
15 #[prost(string, tag = "1")]
16 pub from_table: ::prost::alloc::string::String,
17 #[prost(string, repeated, tag = "2")]
18 pub to_tables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
19}
20#[allow(clippy::derive_partial_eq_without_eq)]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct Keyspace {
24 #[prost(bool, tag = "1")]
26 pub sharded: bool,
27 #[prost(map = "string, message", tag = "2")]
28 pub vindexes: ::std::collections::HashMap<::prost::alloc::string::String, Vindex>,
29 #[prost(map = "string, message", tag = "3")]
30 pub tables: ::std::collections::HashMap<::prost::alloc::string::String, Table>,
31 #[prost(bool, tag = "4")]
33 pub require_explicit_routing: bool,
34 #[prost(enumeration = "keyspace::ForeignKeyMode", tag = "5")]
36 pub foreign_key_mode: i32,
37}
38pub mod keyspace {
40 #[derive(
41 Clone,
42 Copy,
43 Debug,
44 PartialEq,
45 Eq,
46 Hash,
47 PartialOrd,
48 Ord,
49 ::prost::Enumeration
50 )]
51 #[repr(i32)]
52 pub enum ForeignKeyMode {
53 Unspecified = 0,
54 Disallow = 1,
55 Unmanaged = 2,
56 Managed = 3,
57 }
58 impl ForeignKeyMode {
59 pub fn as_str_name(&self) -> &'static str {
64 match self {
65 ForeignKeyMode::Unspecified => "unspecified",
66 ForeignKeyMode::Disallow => "disallow",
67 ForeignKeyMode::Unmanaged => "unmanaged",
68 ForeignKeyMode::Managed => "managed",
69 }
70 }
71 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
73 match value {
74 "unspecified" => Some(Self::Unspecified),
75 "disallow" => Some(Self::Disallow),
76 "unmanaged" => Some(Self::Unmanaged),
77 "managed" => Some(Self::Managed),
78 _ => None,
79 }
80 }
81 }
82}
83#[allow(clippy::derive_partial_eq_without_eq)]
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct Vindex {
87 #[prost(string, tag = "1")]
90 pub r#type: ::prost::alloc::string::String,
91 #[prost(map = "string, string", tag = "2")]
96 pub params: ::std::collections::HashMap<
97 ::prost::alloc::string::String,
98 ::prost::alloc::string::String,
99 >,
100 #[prost(string, tag = "3")]
105 pub owner: ::prost::alloc::string::String,
106}
107#[allow(clippy::derive_partial_eq_without_eq)]
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct Table {
111 #[prost(string, tag = "1")]
120 pub r#type: ::prost::alloc::string::String,
121 #[prost(message, repeated, tag = "2")]
123 pub column_vindexes: ::prost::alloc::vec::Vec<ColumnVindex>,
124 #[prost(message, optional, tag = "3")]
127 pub auto_increment: ::core::option::Option<AutoIncrement>,
128 #[prost(message, repeated, tag = "4")]
130 pub columns: ::prost::alloc::vec::Vec<Column>,
131 #[prost(string, tag = "5")]
136 pub pinned: ::prost::alloc::string::String,
137 #[prost(bool, tag = "6")]
141 pub column_list_authoritative: bool,
142 #[prost(string, tag = "7")]
144 pub source: ::prost::alloc::string::String,
145}
146#[allow(clippy::derive_partial_eq_without_eq)]
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct ColumnVindex {
150 #[prost(string, tag = "1")]
152 pub column: ::prost::alloc::string::String,
153 #[prost(string, tag = "2")]
155 pub name: ::prost::alloc::string::String,
156 #[prost(string, repeated, tag = "3")]
158 pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
159}
160#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct AutoIncrement {
164 #[prost(string, tag = "1")]
165 pub column: ::prost::alloc::string::String,
166 #[prost(string, tag = "2")]
168 pub sequence: ::prost::alloc::string::String,
169}
170#[allow(clippy::derive_partial_eq_without_eq)]
172#[derive(Clone, PartialEq, ::prost::Message)]
173pub struct Column {
174 #[prost(string, tag = "1")]
175 pub name: ::prost::alloc::string::String,
176 #[prost(enumeration = "super::query::Type", tag = "2")]
177 pub r#type: i32,
178}
179#[allow(clippy::derive_partial_eq_without_eq)]
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct SrvVSchema {
183 #[prost(map = "string, message", tag = "1")]
185 pub keyspaces: ::std::collections::HashMap<::prost::alloc::string::String, Keyspace>,
186 #[prost(message, optional, tag = "2")]
188 pub routing_rules: ::core::option::Option<RoutingRules>,
189 #[prost(message, optional, tag = "3")]
190 pub shard_routing_rules: ::core::option::Option<ShardRoutingRules>,
191}
192#[allow(clippy::derive_partial_eq_without_eq)]
194#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct ShardRoutingRules {
196 #[prost(message, repeated, tag = "1")]
197 pub rules: ::prost::alloc::vec::Vec<ShardRoutingRule>,
198}
199#[allow(clippy::derive_partial_eq_without_eq)]
201#[derive(Clone, PartialEq, ::prost::Message)]
202pub struct ShardRoutingRule {
203 #[prost(string, tag = "1")]
204 pub from_keyspace: ::prost::alloc::string::String,
205 #[prost(string, tag = "2")]
206 pub to_keyspace: ::prost::alloc::string::String,
207 #[prost(string, tag = "3")]
208 pub shard: ::prost::alloc::string::String,
209}