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}
240#[derive(prost_helpers::AnyPB)]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct Array {
243 #[prost(enumeration = "ArrayType", tag = "1")]
244 pub array_type: i32,
245 #[prost(message, optional, tag = "2")]
246 pub null_bitmap: ::core::option::Option<super::common::Buffer>,
247 #[prost(message, repeated, tag = "3")]
248 pub values: ::prost::alloc::vec::Vec<super::common::Buffer>,
249 #[prost(message, optional, tag = "4")]
250 pub struct_array_data: ::core::option::Option<StructArrayData>,
251 #[prost(message, optional, boxed, tag = "5")]
252 pub list_array_data: ::core::option::Option<
253 ::prost::alloc::boxed::Box<ListArrayData>,
254 >,
255}
256#[derive(prost_helpers::AnyPB)]
257#[derive(Eq, Hash)]
258#[derive(Clone, PartialEq, ::prost::Message)]
259pub struct Datum {
260 #[prost(bytes = "vec", tag = "1")]
265 pub body: ::prost::alloc::vec::Vec<u8>,
266}
267#[derive(prost_helpers::AnyPB)]
268#[derive(Clone, PartialEq, ::prost::Message)]
269pub struct DataChunk {
270 #[prost(uint32, tag = "1")]
271 pub cardinality: u32,
272 #[prost(message, repeated, tag = "2")]
273 pub columns: ::prost::alloc::vec::Vec<Array>,
274}
275#[derive(prost_helpers::AnyPB)]
276#[derive(Clone, PartialEq, ::prost::Message)]
277pub struct StreamChunk {
278 #[prost(uint32, tag = "1")]
280 pub cardinality: u32,
281 #[prost(enumeration = "Op", repeated, tag = "2")]
282 pub ops: ::prost::alloc::vec::Vec<i32>,
283 #[prost(message, repeated, tag = "3")]
284 pub columns: ::prost::alloc::vec::Vec<Array>,
285}
286#[derive(prost_helpers::AnyPB)]
287#[derive(Clone, Copy, PartialEq, ::prost::Message)]
288pub struct Epoch {
289 #[prost(uint64, tag = "1")]
290 pub curr: u64,
291 #[prost(uint64, tag = "2")]
292 pub prev: u64,
293}
294#[derive(prost_helpers::AnyPB)]
295#[derive(Clone, Copy, PartialEq, ::prost::Message)]
296pub struct Terminate {}
297#[derive(prost_helpers::AnyPB)]
298#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
299#[repr(i32)]
300pub enum ArrayType {
301 Unspecified = 0,
302 Int16 = 1,
303 Int32 = 2,
304 Int64 = 3,
305 Float32 = 4,
306 Float64 = 5,
307 Utf8 = 6,
308 Bool = 7,
309 Decimal = 8,
310 Date = 9,
311 Time = 10,
312 Timestamp = 11,
313 Timestamptz = 19,
314 Interval = 12,
315 Struct = 13,
316 List = 14,
317 Bytea = 15,
318 Jsonb = 16,
319 Serial = 17,
320 Int256 = 18,
321 Map = 20,
322 Vector = 21,
323}
324impl ArrayType {
325 pub fn as_str_name(&self) -> &'static str {
330 match self {
331 Self::Unspecified => "UNSPECIFIED",
332 Self::Int16 => "INT16",
333 Self::Int32 => "INT32",
334 Self::Int64 => "INT64",
335 Self::Float32 => "FLOAT32",
336 Self::Float64 => "FLOAT64",
337 Self::Utf8 => "UTF8",
338 Self::Bool => "BOOL",
339 Self::Decimal => "DECIMAL",
340 Self::Date => "DATE",
341 Self::Time => "TIME",
342 Self::Timestamp => "TIMESTAMP",
343 Self::Timestamptz => "TIMESTAMPTZ",
344 Self::Interval => "INTERVAL",
345 Self::Struct => "STRUCT",
346 Self::List => "LIST",
347 Self::Bytea => "BYTEA",
348 Self::Jsonb => "JSONB",
349 Self::Serial => "SERIAL",
350 Self::Int256 => "INT256",
351 Self::Map => "MAP",
352 Self::Vector => "VECTOR",
353 }
354 }
355 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
357 match value {
358 "UNSPECIFIED" => Some(Self::Unspecified),
359 "INT16" => Some(Self::Int16),
360 "INT32" => Some(Self::Int32),
361 "INT64" => Some(Self::Int64),
362 "FLOAT32" => Some(Self::Float32),
363 "FLOAT64" => Some(Self::Float64),
364 "UTF8" => Some(Self::Utf8),
365 "BOOL" => Some(Self::Bool),
366 "DECIMAL" => Some(Self::Decimal),
367 "DATE" => Some(Self::Date),
368 "TIME" => Some(Self::Time),
369 "TIMESTAMP" => Some(Self::Timestamp),
370 "TIMESTAMPTZ" => Some(Self::Timestamptz),
371 "INTERVAL" => Some(Self::Interval),
372 "STRUCT" => Some(Self::Struct),
373 "LIST" => Some(Self::List),
374 "BYTEA" => Some(Self::Bytea),
375 "JSONB" => Some(Self::Jsonb),
376 "SERIAL" => Some(Self::Serial),
377 "INT256" => Some(Self::Int256),
378 "MAP" => Some(Self::Map),
379 "VECTOR" => Some(Self::Vector),
380 _ => None,
381 }
382 }
383}
384#[derive(prost_helpers::AnyPB)]
385#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
386#[repr(i32)]
387pub enum Op {
388 Unspecified = 0,
389 Insert = 1,
390 Delete = 2,
391 UpdateInsert = 3,
392 UpdateDelete = 4,
393}
394impl Op {
395 pub fn as_str_name(&self) -> &'static str {
400 match self {
401 Self::Unspecified => "OP_UNSPECIFIED",
402 Self::Insert => "INSERT",
403 Self::Delete => "DELETE",
404 Self::UpdateInsert => "UPDATE_INSERT",
405 Self::UpdateDelete => "UPDATE_DELETE",
406 }
407 }
408 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
410 match value {
411 "OP_UNSPECIFIED" => Some(Self::Unspecified),
412 "INSERT" => Some(Self::Insert),
413 "DELETE" => Some(Self::Delete),
414 "UPDATE_INSERT" => Some(Self::UpdateInsert),
415 "UPDATE_DELETE" => Some(Self::UpdateDelete),
416 _ => None,
417 }
418 }
419}