1#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct Interval {
5 #[prost(int32, tag = "1")]
6 pub months: i32,
7 #[prost(int32, tag = "2")]
8 pub days: i32,
9 #[prost(int64, tag = "3")]
10 pub usecs: i64,
11}
12#[derive(prost_helpers::AnyPB)]
13#[derive(Eq, Hash)]
14#[derive(Clone, PartialEq, ::prost::Message)]
15#[prost(skip_debug)]
16pub struct DataType {
17 #[prost(enumeration = "data_type::TypeName", tag = "1")]
18 pub type_name: i32,
19 #[prost(uint32, tag = "2")]
23 pub precision: u32,
24 #[prost(uint32, tag = "3")]
26 pub scale: u32,
27 #[prost(bool, tag = "4")]
28 pub is_nullable: bool,
29 #[prost(enumeration = "data_type::IntervalType", tag = "5")]
30 pub interval_type: i32,
31 #[prost(message, repeated, tag = "6")]
35 pub field_type: ::prost::alloc::vec::Vec<DataType>,
36 #[prost(string, repeated, tag = "7")]
38 pub field_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
39 #[prost(int32, repeated, tag = "8")]
46 pub field_ids: ::prost::alloc::vec::Vec<i32>,
47}
48pub mod data_type {
50 #[derive(prost_helpers::AnyPB)]
51 #[derive(
52 Clone,
53 Copy,
54 Debug,
55 PartialEq,
56 Eq,
57 Hash,
58 PartialOrd,
59 Ord,
60 ::prost::Enumeration
61 )]
62 #[repr(i32)]
63 pub enum IntervalType {
64 Unspecified = 0,
65 Year = 1,
66 Month = 2,
67 Day = 3,
68 Hour = 4,
69 Minute = 5,
70 Second = 6,
71 YearToMonth = 7,
72 DayToHour = 8,
73 DayToMinute = 9,
74 DayToSecond = 10,
75 HourToMinute = 11,
76 HourToSecond = 12,
77 MinuteToSecond = 13,
78 }
79 impl IntervalType {
80 pub fn as_str_name(&self) -> &'static str {
85 match self {
86 Self::Unspecified => "UNSPECIFIED",
87 Self::Year => "YEAR",
88 Self::Month => "MONTH",
89 Self::Day => "DAY",
90 Self::Hour => "HOUR",
91 Self::Minute => "MINUTE",
92 Self::Second => "SECOND",
93 Self::YearToMonth => "YEAR_TO_MONTH",
94 Self::DayToHour => "DAY_TO_HOUR",
95 Self::DayToMinute => "DAY_TO_MINUTE",
96 Self::DayToSecond => "DAY_TO_SECOND",
97 Self::HourToMinute => "HOUR_TO_MINUTE",
98 Self::HourToSecond => "HOUR_TO_SECOND",
99 Self::MinuteToSecond => "MINUTE_TO_SECOND",
100 }
101 }
102 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
104 match value {
105 "UNSPECIFIED" => Some(Self::Unspecified),
106 "YEAR" => Some(Self::Year),
107 "MONTH" => Some(Self::Month),
108 "DAY" => Some(Self::Day),
109 "HOUR" => Some(Self::Hour),
110 "MINUTE" => Some(Self::Minute),
111 "SECOND" => Some(Self::Second),
112 "YEAR_TO_MONTH" => Some(Self::YearToMonth),
113 "DAY_TO_HOUR" => Some(Self::DayToHour),
114 "DAY_TO_MINUTE" => Some(Self::DayToMinute),
115 "DAY_TO_SECOND" => Some(Self::DayToSecond),
116 "HOUR_TO_MINUTE" => Some(Self::HourToMinute),
117 "HOUR_TO_SECOND" => Some(Self::HourToSecond),
118 "MINUTE_TO_SECOND" => Some(Self::MinuteToSecond),
119 _ => None,
120 }
121 }
122 }
123 #[derive(prost_helpers::AnyPB)]
124 #[derive(
125 Clone,
126 Copy,
127 Debug,
128 PartialEq,
129 Eq,
130 Hash,
131 PartialOrd,
132 Ord,
133 ::prost::Enumeration
134 )]
135 #[repr(i32)]
136 pub enum TypeName {
137 TypeUnspecified = 0,
138 Int16 = 1,
139 Int32 = 2,
140 Int64 = 3,
141 Float = 4,
142 Double = 5,
143 Boolean = 6,
144 Varchar = 7,
145 Decimal = 8,
146 Time = 9,
147 Timestamp = 10,
148 Interval = 11,
149 Date = 12,
150 Timestamptz = 13,
152 Struct = 15,
153 List = 16,
154 Bytea = 17,
155 Jsonb = 18,
156 Serial = 19,
157 Int256 = 20,
158 Map = 21,
159 Vector = 22,
160 }
161 impl TypeName {
162 pub fn as_str_name(&self) -> &'static str {
167 match self {
168 Self::TypeUnspecified => "TYPE_UNSPECIFIED",
169 Self::Int16 => "INT16",
170 Self::Int32 => "INT32",
171 Self::Int64 => "INT64",
172 Self::Float => "FLOAT",
173 Self::Double => "DOUBLE",
174 Self::Boolean => "BOOLEAN",
175 Self::Varchar => "VARCHAR",
176 Self::Decimal => "DECIMAL",
177 Self::Time => "TIME",
178 Self::Timestamp => "TIMESTAMP",
179 Self::Interval => "INTERVAL",
180 Self::Date => "DATE",
181 Self::Timestamptz => "TIMESTAMPTZ",
182 Self::Struct => "STRUCT",
183 Self::List => "LIST",
184 Self::Bytea => "BYTEA",
185 Self::Jsonb => "JSONB",
186 Self::Serial => "SERIAL",
187 Self::Int256 => "INT256",
188 Self::Map => "MAP",
189 Self::Vector => "VECTOR",
190 }
191 }
192 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
194 match value {
195 "TYPE_UNSPECIFIED" => Some(Self::TypeUnspecified),
196 "INT16" => Some(Self::Int16),
197 "INT32" => Some(Self::Int32),
198 "INT64" => Some(Self::Int64),
199 "FLOAT" => Some(Self::Float),
200 "DOUBLE" => Some(Self::Double),
201 "BOOLEAN" => Some(Self::Boolean),
202 "VARCHAR" => Some(Self::Varchar),
203 "DECIMAL" => Some(Self::Decimal),
204 "TIME" => Some(Self::Time),
205 "TIMESTAMP" => Some(Self::Timestamp),
206 "INTERVAL" => Some(Self::Interval),
207 "DATE" => Some(Self::Date),
208 "TIMESTAMPTZ" => Some(Self::Timestamptz),
209 "STRUCT" => Some(Self::Struct),
210 "LIST" => Some(Self::List),
211 "BYTEA" => Some(Self::Bytea),
212 "JSONB" => Some(Self::Jsonb),
213 "SERIAL" => Some(Self::Serial),
214 "INT256" => Some(Self::Int256),
215 "MAP" => Some(Self::Map),
216 "VECTOR" => Some(Self::Vector),
217 _ => None,
218 }
219 }
220 }
221}
222#[derive(prost_helpers::AnyPB)]
223#[derive(Clone, PartialEq, ::prost::Message)]
224pub struct StructArrayData {
225 #[prost(message, repeated, tag = "1")]
226 pub children_array: ::prost::alloc::vec::Vec<Array>,
227 #[prost(message, repeated, tag = "2")]
228 pub children_type: ::prost::alloc::vec::Vec<DataType>,
229}
230#[derive(prost_helpers::AnyPB)]
231#[derive(Clone, PartialEq, ::prost::Message)]
232pub struct ListArrayData {
233 #[prost(uint32, repeated, tag = "1")]
234 pub offsets: ::prost::alloc::vec::Vec<u32>,
235 #[prost(message, optional, boxed, tag = "2")]
236 pub value: ::core::option::Option<::prost::alloc::boxed::Box<Array>>,
237 #[prost(message, optional, tag = "3")]
238 pub value_type: ::core::option::Option<DataType>,
239 #[prost(uint32, optional, tag = "4")]
242 pub elem_size: ::core::option::Option<u32>,
243}
244#[derive(prost_helpers::AnyPB)]
245#[derive(Clone, PartialEq, ::prost::Message)]
246pub struct Array {
247 #[prost(enumeration = "ArrayType", tag = "1")]
248 pub array_type: i32,
249 #[prost(message, optional, tag = "2")]
250 pub null_bitmap: ::core::option::Option<super::common::Buffer>,
251 #[prost(message, repeated, tag = "3")]
252 pub values: ::prost::alloc::vec::Vec<super::common::Buffer>,
253 #[prost(message, optional, tag = "4")]
254 pub struct_array_data: ::core::option::Option<StructArrayData>,
255 #[prost(message, optional, boxed, tag = "5")]
256 pub list_array_data: ::core::option::Option<
257 ::prost::alloc::boxed::Box<ListArrayData>,
258 >,
259}
260#[derive(prost_helpers::AnyPB)]
261#[derive(Eq, Hash)]
262#[derive(Clone, PartialEq, ::prost::Message)]
263pub struct Datum {
264 #[prost(bytes = "vec", tag = "1")]
269 pub body: ::prost::alloc::vec::Vec<u8>,
270}
271#[derive(prost_helpers::AnyPB)]
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct DataChunk {
274 #[prost(uint32, tag = "1")]
275 pub cardinality: u32,
276 #[prost(message, repeated, tag = "2")]
277 pub columns: ::prost::alloc::vec::Vec<Array>,
278}
279#[derive(prost_helpers::AnyPB)]
280#[derive(Clone, PartialEq, ::prost::Message)]
281pub struct StreamChunk {
282 #[prost(uint32, tag = "1")]
284 pub cardinality: u32,
285 #[prost(enumeration = "Op", repeated, tag = "2")]
286 pub ops: ::prost::alloc::vec::Vec<i32>,
287 #[prost(message, repeated, tag = "3")]
288 pub columns: ::prost::alloc::vec::Vec<Array>,
289}
290#[derive(prost_helpers::AnyPB)]
291#[derive(Clone, Copy, PartialEq, ::prost::Message)]
292pub struct Epoch {
293 #[prost(uint64, tag = "1")]
294 pub curr: u64,
295 #[prost(uint64, tag = "2")]
296 pub prev: u64,
297}
298#[derive(prost_helpers::AnyPB)]
299#[derive(Clone, Copy, PartialEq, ::prost::Message)]
300pub struct Terminate {}
301#[derive(prost_helpers::AnyPB)]
302#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
303#[repr(i32)]
304pub enum ArrayType {
305 Unspecified = 0,
306 Int16 = 1,
307 Int32 = 2,
308 Int64 = 3,
309 Float32 = 4,
310 Float64 = 5,
311 Utf8 = 6,
312 Bool = 7,
313 Decimal = 8,
314 Date = 9,
315 Time = 10,
316 Timestamp = 11,
317 Timestamptz = 19,
318 Interval = 12,
319 Struct = 13,
320 List = 14,
321 Bytea = 15,
322 Jsonb = 16,
323 Serial = 17,
324 Int256 = 18,
325 Map = 20,
326 Vector = 21,
327}
328impl ArrayType {
329 pub fn as_str_name(&self) -> &'static str {
334 match self {
335 Self::Unspecified => "UNSPECIFIED",
336 Self::Int16 => "INT16",
337 Self::Int32 => "INT32",
338 Self::Int64 => "INT64",
339 Self::Float32 => "FLOAT32",
340 Self::Float64 => "FLOAT64",
341 Self::Utf8 => "UTF8",
342 Self::Bool => "BOOL",
343 Self::Decimal => "DECIMAL",
344 Self::Date => "DATE",
345 Self::Time => "TIME",
346 Self::Timestamp => "TIMESTAMP",
347 Self::Timestamptz => "TIMESTAMPTZ",
348 Self::Interval => "INTERVAL",
349 Self::Struct => "STRUCT",
350 Self::List => "LIST",
351 Self::Bytea => "BYTEA",
352 Self::Jsonb => "JSONB",
353 Self::Serial => "SERIAL",
354 Self::Int256 => "INT256",
355 Self::Map => "MAP",
356 Self::Vector => "VECTOR",
357 }
358 }
359 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
361 match value {
362 "UNSPECIFIED" => Some(Self::Unspecified),
363 "INT16" => Some(Self::Int16),
364 "INT32" => Some(Self::Int32),
365 "INT64" => Some(Self::Int64),
366 "FLOAT32" => Some(Self::Float32),
367 "FLOAT64" => Some(Self::Float64),
368 "UTF8" => Some(Self::Utf8),
369 "BOOL" => Some(Self::Bool),
370 "DECIMAL" => Some(Self::Decimal),
371 "DATE" => Some(Self::Date),
372 "TIME" => Some(Self::Time),
373 "TIMESTAMP" => Some(Self::Timestamp),
374 "TIMESTAMPTZ" => Some(Self::Timestamptz),
375 "INTERVAL" => Some(Self::Interval),
376 "STRUCT" => Some(Self::Struct),
377 "LIST" => Some(Self::List),
378 "BYTEA" => Some(Self::Bytea),
379 "JSONB" => Some(Self::Jsonb),
380 "SERIAL" => Some(Self::Serial),
381 "INT256" => Some(Self::Int256),
382 "MAP" => Some(Self::Map),
383 "VECTOR" => Some(Self::Vector),
384 _ => None,
385 }
386 }
387}
388#[derive(prost_helpers::AnyPB)]
389#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
390#[repr(i32)]
391pub enum Op {
392 Unspecified = 0,
393 Insert = 1,
394 Delete = 2,
395 UpdateInsert = 3,
396 UpdateDelete = 4,
397}
398impl Op {
399 pub fn as_str_name(&self) -> &'static str {
404 match self {
405 Self::Unspecified => "OP_UNSPECIFIED",
406 Self::Insert => "INSERT",
407 Self::Delete => "DELETE",
408 Self::UpdateInsert => "UPDATE_INSERT",
409 Self::UpdateDelete => "UPDATE_DELETE",
410 }
411 }
412 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
414 match value {
415 "OP_UNSPECIFIED" => Some(Self::Unspecified),
416 "INSERT" => Some(Self::Insert),
417 "DELETE" => Some(Self::Delete),
418 "UPDATE_INSERT" => Some(Self::UpdateInsert),
419 "UPDATE_DELETE" => Some(Self::UpdateDelete),
420 _ => None,
421 }
422 }
423}