#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Interval {
#[prost(int32, tag = "1")]
pub months: i32,
#[prost(int32, tag = "2")]
pub days: i32,
#[prost(int64, tag = "3")]
pub usecs: i64,
}
#[derive(prost_helpers::AnyPB)]
#[derive(Eq, Hash)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct DataType {
#[prost(enumeration = "data_type::TypeName", tag = "1")]
pub type_name: i32,
#[prost(uint32, tag = "2")]
pub precision: u32,
#[prost(uint32, tag = "3")]
pub scale: u32,
#[prost(bool, tag = "4")]
pub is_nullable: bool,
#[prost(enumeration = "data_type::IntervalType", tag = "5")]
pub interval_type: i32,
#[prost(message, repeated, tag = "6")]
pub field_type: ::prost::alloc::vec::Vec<DataType>,
#[prost(string, repeated, tag = "7")]
pub field_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
pub mod data_type {
#[derive(prost_helpers::AnyPB)]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum IntervalType {
Unspecified = 0,
Year = 1,
Month = 2,
Day = 3,
Hour = 4,
Minute = 5,
Second = 6,
YearToMonth = 7,
DayToHour = 8,
DayToMinute = 9,
DayToSecond = 10,
HourToMinute = 11,
HourToSecond = 12,
MinuteToSecond = 13,
}
impl IntervalType {
pub fn as_str_name(&self) -> &'static str {
match self {
IntervalType::Unspecified => "UNSPECIFIED",
IntervalType::Year => "YEAR",
IntervalType::Month => "MONTH",
IntervalType::Day => "DAY",
IntervalType::Hour => "HOUR",
IntervalType::Minute => "MINUTE",
IntervalType::Second => "SECOND",
IntervalType::YearToMonth => "YEAR_TO_MONTH",
IntervalType::DayToHour => "DAY_TO_HOUR",
IntervalType::DayToMinute => "DAY_TO_MINUTE",
IntervalType::DayToSecond => "DAY_TO_SECOND",
IntervalType::HourToMinute => "HOUR_TO_MINUTE",
IntervalType::HourToSecond => "HOUR_TO_SECOND",
IntervalType::MinuteToSecond => "MINUTE_TO_SECOND",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSPECIFIED" => Some(Self::Unspecified),
"YEAR" => Some(Self::Year),
"MONTH" => Some(Self::Month),
"DAY" => Some(Self::Day),
"HOUR" => Some(Self::Hour),
"MINUTE" => Some(Self::Minute),
"SECOND" => Some(Self::Second),
"YEAR_TO_MONTH" => Some(Self::YearToMonth),
"DAY_TO_HOUR" => Some(Self::DayToHour),
"DAY_TO_MINUTE" => Some(Self::DayToMinute),
"DAY_TO_SECOND" => Some(Self::DayToSecond),
"HOUR_TO_MINUTE" => Some(Self::HourToMinute),
"HOUR_TO_SECOND" => Some(Self::HourToSecond),
"MINUTE_TO_SECOND" => Some(Self::MinuteToSecond),
_ => None,
}
}
}
#[derive(prost_helpers::AnyPB)]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TypeName {
TypeUnspecified = 0,
Int16 = 1,
Int32 = 2,
Int64 = 3,
Float = 4,
Double = 5,
Boolean = 6,
Varchar = 7,
Decimal = 8,
Time = 9,
Timestamp = 10,
Interval = 11,
Date = 12,
Timestamptz = 13,
Struct = 15,
List = 16,
Bytea = 17,
Jsonb = 18,
Serial = 19,
Int256 = 20,
Map = 21,
}
impl TypeName {
pub fn as_str_name(&self) -> &'static str {
match self {
TypeName::TypeUnspecified => "TYPE_UNSPECIFIED",
TypeName::Int16 => "INT16",
TypeName::Int32 => "INT32",
TypeName::Int64 => "INT64",
TypeName::Float => "FLOAT",
TypeName::Double => "DOUBLE",
TypeName::Boolean => "BOOLEAN",
TypeName::Varchar => "VARCHAR",
TypeName::Decimal => "DECIMAL",
TypeName::Time => "TIME",
TypeName::Timestamp => "TIMESTAMP",
TypeName::Interval => "INTERVAL",
TypeName::Date => "DATE",
TypeName::Timestamptz => "TIMESTAMPTZ",
TypeName::Struct => "STRUCT",
TypeName::List => "LIST",
TypeName::Bytea => "BYTEA",
TypeName::Jsonb => "JSONB",
TypeName::Serial => "SERIAL",
TypeName::Int256 => "INT256",
TypeName::Map => "MAP",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_UNSPECIFIED" => Some(Self::TypeUnspecified),
"INT16" => Some(Self::Int16),
"INT32" => Some(Self::Int32),
"INT64" => Some(Self::Int64),
"FLOAT" => Some(Self::Float),
"DOUBLE" => Some(Self::Double),
"BOOLEAN" => Some(Self::Boolean),
"VARCHAR" => Some(Self::Varchar),
"DECIMAL" => Some(Self::Decimal),
"TIME" => Some(Self::Time),
"TIMESTAMP" => Some(Self::Timestamp),
"INTERVAL" => Some(Self::Interval),
"DATE" => Some(Self::Date),
"TIMESTAMPTZ" => Some(Self::Timestamptz),
"STRUCT" => Some(Self::Struct),
"LIST" => Some(Self::List),
"BYTEA" => Some(Self::Bytea),
"JSONB" => Some(Self::Jsonb),
"SERIAL" => Some(Self::Serial),
"INT256" => Some(Self::Int256),
"MAP" => Some(Self::Map),
_ => None,
}
}
}
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StructArrayData {
#[prost(message, repeated, tag = "1")]
pub children_array: ::prost::alloc::vec::Vec<Array>,
#[prost(message, repeated, tag = "2")]
pub children_type: ::prost::alloc::vec::Vec<DataType>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListArrayData {
#[prost(uint32, repeated, tag = "1")]
pub offsets: ::prost::alloc::vec::Vec<u32>,
#[prost(message, optional, boxed, tag = "2")]
pub value: ::core::option::Option<::prost::alloc::boxed::Box<Array>>,
#[prost(message, optional, tag = "3")]
pub value_type: ::core::option::Option<DataType>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Array {
#[prost(enumeration = "ArrayType", tag = "1")]
pub array_type: i32,
#[prost(message, optional, tag = "2")]
pub null_bitmap: ::core::option::Option<super::common::Buffer>,
#[prost(message, repeated, tag = "3")]
pub values: ::prost::alloc::vec::Vec<super::common::Buffer>,
#[prost(message, optional, tag = "4")]
pub struct_array_data: ::core::option::Option<StructArrayData>,
#[prost(message, optional, boxed, tag = "5")]
pub list_array_data: ::core::option::Option<
::prost::alloc::boxed::Box<ListArrayData>,
>,
}
#[derive(prost_helpers::AnyPB)]
#[derive(Eq, Hash)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Datum {
#[prost(bytes = "vec", tag = "1")]
pub body: ::prost::alloc::vec::Vec<u8>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataChunk {
#[prost(uint32, tag = "1")]
pub cardinality: u32,
#[prost(message, repeated, tag = "2")]
pub columns: ::prost::alloc::vec::Vec<Array>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamChunk {
#[prost(uint32, tag = "1")]
pub cardinality: u32,
#[prost(enumeration = "Op", repeated, tag = "2")]
pub ops: ::prost::alloc::vec::Vec<i32>,
#[prost(message, repeated, tag = "3")]
pub columns: ::prost::alloc::vec::Vec<Array>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Epoch {
#[prost(uint64, tag = "1")]
pub curr: u64,
#[prost(uint64, tag = "2")]
pub prev: u64,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Terminate {}
#[derive(prost_helpers::AnyPB)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ArrayType {
Unspecified = 0,
Int16 = 1,
Int32 = 2,
Int64 = 3,
Float32 = 4,
Float64 = 5,
Utf8 = 6,
Bool = 7,
Decimal = 8,
Date = 9,
Time = 10,
Timestamp = 11,
Timestamptz = 19,
Interval = 12,
Struct = 13,
List = 14,
Bytea = 15,
Jsonb = 16,
Serial = 17,
Int256 = 18,
Map = 20,
}
impl ArrayType {
pub fn as_str_name(&self) -> &'static str {
match self {
ArrayType::Unspecified => "UNSPECIFIED",
ArrayType::Int16 => "INT16",
ArrayType::Int32 => "INT32",
ArrayType::Int64 => "INT64",
ArrayType::Float32 => "FLOAT32",
ArrayType::Float64 => "FLOAT64",
ArrayType::Utf8 => "UTF8",
ArrayType::Bool => "BOOL",
ArrayType::Decimal => "DECIMAL",
ArrayType::Date => "DATE",
ArrayType::Time => "TIME",
ArrayType::Timestamp => "TIMESTAMP",
ArrayType::Timestamptz => "TIMESTAMPTZ",
ArrayType::Interval => "INTERVAL",
ArrayType::Struct => "STRUCT",
ArrayType::List => "LIST",
ArrayType::Bytea => "BYTEA",
ArrayType::Jsonb => "JSONB",
ArrayType::Serial => "SERIAL",
ArrayType::Int256 => "INT256",
ArrayType::Map => "MAP",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSPECIFIED" => Some(Self::Unspecified),
"INT16" => Some(Self::Int16),
"INT32" => Some(Self::Int32),
"INT64" => Some(Self::Int64),
"FLOAT32" => Some(Self::Float32),
"FLOAT64" => Some(Self::Float64),
"UTF8" => Some(Self::Utf8),
"BOOL" => Some(Self::Bool),
"DECIMAL" => Some(Self::Decimal),
"DATE" => Some(Self::Date),
"TIME" => Some(Self::Time),
"TIMESTAMP" => Some(Self::Timestamp),
"TIMESTAMPTZ" => Some(Self::Timestamptz),
"INTERVAL" => Some(Self::Interval),
"STRUCT" => Some(Self::Struct),
"LIST" => Some(Self::List),
"BYTEA" => Some(Self::Bytea),
"JSONB" => Some(Self::Jsonb),
"SERIAL" => Some(Self::Serial),
"INT256" => Some(Self::Int256),
"MAP" => Some(Self::Map),
_ => None,
}
}
}
#[derive(prost_helpers::AnyPB)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Op {
Unspecified = 0,
Insert = 1,
Delete = 2,
UpdateInsert = 3,
UpdateDelete = 4,
}
impl Op {
pub fn as_str_name(&self) -> &'static str {
match self {
Op::Unspecified => "OP_UNSPECIFIED",
Op::Insert => "INSERT",
Op::Delete => "DELETE",
Op::UpdateInsert => "UPDATE_INSERT",
Op::UpdateDelete => "UPDATE_DELETE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OP_UNSPECIFIED" => Some(Self::Unspecified),
"INSERT" => Some(Self::Insert),
"DELETE" => Some(Self::Delete),
"UPDATE_INSERT" => Some(Self::UpdateInsert),
"UPDATE_DELETE" => Some(Self::UpdateDelete),
_ => None,
}
}
}