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