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 }
160 impl TypeName {
161 pub fn as_str_name(&self) -> &'static str {
166 match self {
167 Self::TypeUnspecified => "TYPE_UNSPECIFIED",
168 Self::Int16 => "INT16",
169 Self::Int32 => "INT32",
170 Self::Int64 => "INT64",
171 Self::Float => "FLOAT",
172 Self::Double => "DOUBLE",
173 Self::Boolean => "BOOLEAN",
174 Self::Varchar => "VARCHAR",
175 Self::Decimal => "DECIMAL",
176 Self::Time => "TIME",
177 Self::Timestamp => "TIMESTAMP",
178 Self::Interval => "INTERVAL",
179 Self::Date => "DATE",
180 Self::Timestamptz => "TIMESTAMPTZ",
181 Self::Struct => "STRUCT",
182 Self::List => "LIST",
183 Self::Bytea => "BYTEA",
184 Self::Jsonb => "JSONB",
185 Self::Serial => "SERIAL",
186 Self::Int256 => "INT256",
187 Self::Map => "MAP",
188 }
189 }
190 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
192 match value {
193 "TYPE_UNSPECIFIED" => Some(Self::TypeUnspecified),
194 "INT16" => Some(Self::Int16),
195 "INT32" => Some(Self::Int32),
196 "INT64" => Some(Self::Int64),
197 "FLOAT" => Some(Self::Float),
198 "DOUBLE" => Some(Self::Double),
199 "BOOLEAN" => Some(Self::Boolean),
200 "VARCHAR" => Some(Self::Varchar),
201 "DECIMAL" => Some(Self::Decimal),
202 "TIME" => Some(Self::Time),
203 "TIMESTAMP" => Some(Self::Timestamp),
204 "INTERVAL" => Some(Self::Interval),
205 "DATE" => Some(Self::Date),
206 "TIMESTAMPTZ" => Some(Self::Timestamptz),
207 "STRUCT" => Some(Self::Struct),
208 "LIST" => Some(Self::List),
209 "BYTEA" => Some(Self::Bytea),
210 "JSONB" => Some(Self::Jsonb),
211 "SERIAL" => Some(Self::Serial),
212 "INT256" => Some(Self::Int256),
213 "MAP" => Some(Self::Map),
214 _ => None,
215 }
216 }
217 }
218}
219#[derive(prost_helpers::AnyPB)]
220#[derive(Clone, PartialEq, ::prost::Message)]
221pub struct StructArrayData {
222 #[prost(message, repeated, tag = "1")]
223 pub children_array: ::prost::alloc::vec::Vec<Array>,
224 #[prost(message, repeated, tag = "2")]
225 pub children_type: ::prost::alloc::vec::Vec<DataType>,
226}
227#[derive(prost_helpers::AnyPB)]
228#[derive(Clone, PartialEq, ::prost::Message)]
229pub struct ListArrayData {
230 #[prost(uint32, repeated, tag = "1")]
231 pub offsets: ::prost::alloc::vec::Vec<u32>,
232 #[prost(message, optional, boxed, tag = "2")]
233 pub value: ::core::option::Option<::prost::alloc::boxed::Box<Array>>,
234 #[prost(message, optional, tag = "3")]
235 pub value_type: ::core::option::Option<DataType>,
236}
237#[derive(prost_helpers::AnyPB)]
238#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct Array {
240 #[prost(enumeration = "ArrayType", tag = "1")]
241 pub array_type: i32,
242 #[prost(message, optional, tag = "2")]
243 pub null_bitmap: ::core::option::Option<super::common::Buffer>,
244 #[prost(message, repeated, tag = "3")]
245 pub values: ::prost::alloc::vec::Vec<super::common::Buffer>,
246 #[prost(message, optional, tag = "4")]
247 pub struct_array_data: ::core::option::Option<StructArrayData>,
248 #[prost(message, optional, boxed, tag = "5")]
249 pub list_array_data: ::core::option::Option<
250 ::prost::alloc::boxed::Box<ListArrayData>,
251 >,
252}
253#[derive(prost_helpers::AnyPB)]
254#[derive(Eq, Hash)]
255#[derive(Clone, PartialEq, ::prost::Message)]
256pub struct Datum {
257 #[prost(bytes = "vec", tag = "1")]
262 pub body: ::prost::alloc::vec::Vec<u8>,
263}
264#[derive(prost_helpers::AnyPB)]
265#[derive(Clone, PartialEq, ::prost::Message)]
266pub struct DataChunk {
267 #[prost(uint32, tag = "1")]
268 pub cardinality: u32,
269 #[prost(message, repeated, tag = "2")]
270 pub columns: ::prost::alloc::vec::Vec<Array>,
271}
272#[derive(prost_helpers::AnyPB)]
273#[derive(Clone, PartialEq, ::prost::Message)]
274pub struct StreamChunk {
275 #[prost(uint32, tag = "1")]
277 pub cardinality: u32,
278 #[prost(enumeration = "Op", repeated, tag = "2")]
279 pub ops: ::prost::alloc::vec::Vec<i32>,
280 #[prost(message, repeated, tag = "3")]
281 pub columns: ::prost::alloc::vec::Vec<Array>,
282}
283#[derive(prost_helpers::AnyPB)]
284#[derive(Clone, Copy, PartialEq, ::prost::Message)]
285pub struct Epoch {
286 #[prost(uint64, tag = "1")]
287 pub curr: u64,
288 #[prost(uint64, tag = "2")]
289 pub prev: u64,
290}
291#[derive(prost_helpers::AnyPB)]
292#[derive(Clone, Copy, PartialEq, ::prost::Message)]
293pub struct Terminate {}
294#[derive(prost_helpers::AnyPB)]
295#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
296#[repr(i32)]
297pub enum ArrayType {
298 Unspecified = 0,
299 Int16 = 1,
300 Int32 = 2,
301 Int64 = 3,
302 Float32 = 4,
303 Float64 = 5,
304 Utf8 = 6,
305 Bool = 7,
306 Decimal = 8,
307 Date = 9,
308 Time = 10,
309 Timestamp = 11,
310 Timestamptz = 19,
311 Interval = 12,
312 Struct = 13,
313 List = 14,
314 Bytea = 15,
315 Jsonb = 16,
316 Serial = 17,
317 Int256 = 18,
318 Map = 20,
319}
320impl ArrayType {
321 pub fn as_str_name(&self) -> &'static str {
326 match self {
327 Self::Unspecified => "UNSPECIFIED",
328 Self::Int16 => "INT16",
329 Self::Int32 => "INT32",
330 Self::Int64 => "INT64",
331 Self::Float32 => "FLOAT32",
332 Self::Float64 => "FLOAT64",
333 Self::Utf8 => "UTF8",
334 Self::Bool => "BOOL",
335 Self::Decimal => "DECIMAL",
336 Self::Date => "DATE",
337 Self::Time => "TIME",
338 Self::Timestamp => "TIMESTAMP",
339 Self::Timestamptz => "TIMESTAMPTZ",
340 Self::Interval => "INTERVAL",
341 Self::Struct => "STRUCT",
342 Self::List => "LIST",
343 Self::Bytea => "BYTEA",
344 Self::Jsonb => "JSONB",
345 Self::Serial => "SERIAL",
346 Self::Int256 => "INT256",
347 Self::Map => "MAP",
348 }
349 }
350 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
352 match value {
353 "UNSPECIFIED" => Some(Self::Unspecified),
354 "INT16" => Some(Self::Int16),
355 "INT32" => Some(Self::Int32),
356 "INT64" => Some(Self::Int64),
357 "FLOAT32" => Some(Self::Float32),
358 "FLOAT64" => Some(Self::Float64),
359 "UTF8" => Some(Self::Utf8),
360 "BOOL" => Some(Self::Bool),
361 "DECIMAL" => Some(Self::Decimal),
362 "DATE" => Some(Self::Date),
363 "TIME" => Some(Self::Time),
364 "TIMESTAMP" => Some(Self::Timestamp),
365 "TIMESTAMPTZ" => Some(Self::Timestamptz),
366 "INTERVAL" => Some(Self::Interval),
367 "STRUCT" => Some(Self::Struct),
368 "LIST" => Some(Self::List),
369 "BYTEA" => Some(Self::Bytea),
370 "JSONB" => Some(Self::Jsonb),
371 "SERIAL" => Some(Self::Serial),
372 "INT256" => Some(Self::Int256),
373 "MAP" => Some(Self::Map),
374 _ => None,
375 }
376 }
377}
378#[derive(prost_helpers::AnyPB)]
379#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
380#[repr(i32)]
381pub enum Op {
382 Unspecified = 0,
383 Insert = 1,
384 Delete = 2,
385 UpdateInsert = 3,
386 UpdateDelete = 4,
387}
388impl Op {
389 pub fn as_str_name(&self) -> &'static str {
394 match self {
395 Self::Unspecified => "OP_UNSPECIFIED",
396 Self::Insert => "INSERT",
397 Self::Delete => "DELETE",
398 Self::UpdateInsert => "UPDATE_INSERT",
399 Self::UpdateDelete => "UPDATE_DELETE",
400 }
401 }
402 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
404 match value {
405 "OP_UNSPECIFIED" => Some(Self::Unspecified),
406 "INSERT" => Some(Self::Insert),
407 "DELETE" => Some(Self::Delete),
408 "UPDATE_INSERT" => Some(Self::UpdateInsert),
409 "UPDATE_DELETE" => Some(Self::UpdateDelete),
410 _ => None,
411 }
412 }
413}