#[non_exhaustive]pub enum DataTypeNode {
Show 45 variants
Bool,
UInt8,
UInt16,
UInt32,
UInt64,
UInt128,
UInt256,
Int8,
Int16,
Int32,
Int64,
Int128,
Int256,
Float32,
Float64,
BFloat16,
Decimal(u8, u8, DecimalType),
String,
FixedString(usize),
UUID,
Date,
Date32,
DateTime(Option<String>),
DateTime64(DateTimePrecision, Option<String>),
Time,
Time64(DateTimePrecision),
Interval(IntervalType),
IPv4,
IPv6,
Nullable(Box<DataTypeNode>),
LowCardinality(Box<DataTypeNode>),
Array(Box<DataTypeNode>),
Tuple(Vec<DataTypeNode>),
Enum(EnumType, HashMap<i16, String>),
Map([Box<DataTypeNode>; 2]),
AggregateFunction(String, Vec<DataTypeNode>),
Variant(Vec<DataTypeNode>),
Dynamic,
JSON,
Point,
Ring,
LineString,
MultiLineString,
Polygon,
MultiPolygon,
}
Expand description
Represents a data type in ClickHouse. See https://clickhouse.com/docs/sql-reference/data-types
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Bool
UInt8
UInt16
UInt32
UInt64
UInt128
UInt256
Int8
Int16
Int32
Int64
Int128
Int256
Float32
Float64
BFloat16
Decimal(u8, u8, DecimalType)
Scale, Precision, 32 | 64 | 128 | 256
String
FixedString(usize)
UUID
Date
Date32
DateTime(Option<String>)
Optional timezone
DateTime64(DateTimePrecision, Option<String>)
Precision and optional timezone
Time
Time-of-day, no timezone (timezone is ignored in value operations)
Time64(DateTimePrecision)
Precision and optional timezone (timezone is ignored in value operations)
Interval(IntervalType)
IPv4
IPv6
Nullable(Box<DataTypeNode>)
LowCardinality(Box<DataTypeNode>)
Array(Box<DataTypeNode>)
Tuple(Vec<DataTypeNode>)
Enum(EnumType, HashMap<i16, String>)
Map([Box<DataTypeNode>; 2])
Key-Value pairs are defined as an array, so it can be used as a slice
AggregateFunction(String, Vec<DataTypeNode>)
Function name and its arguments
Variant(Vec<DataTypeNode>)
Contains all possible types for this variant
Dynamic
JSON
Point
Ring
LineString
MultiLineString
Polygon
MultiPolygon
Implementations§
Source§impl DataTypeNode
impl DataTypeNode
Sourcepub fn new(name: &str) -> Result<Self, TypesError>
pub fn new(name: &str) -> Result<Self, TypesError>
Parses a data type from a string that is received
in the RowBinaryWithNamesAndTypes
and Native
formats headers.
See also: https://clickhouse.com/docs/interfaces/formats/RowBinaryWithNamesAndTypes#description
Sourcepub fn remove_low_cardinality(&self) -> &DataTypeNode
pub fn remove_low_cardinality(&self) -> &DataTypeNode
LowCardinality(T) -> T
Trait Implementations§
Source§impl Clone for DataTypeNode
impl Clone for DataTypeNode
Source§fn clone(&self) -> DataTypeNode
fn clone(&self) -> DataTypeNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DataTypeNode
impl Debug for DataTypeNode
Source§impl Display for DataTypeNode
impl Display for DataTypeNode
Source§impl From<DataTypeNode> for String
impl From<DataTypeNode> for String
Source§fn from(value: DataTypeNode) -> Self
fn from(value: DataTypeNode) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DataTypeNode
impl PartialEq for DataTypeNode
impl StructuralPartialEq for DataTypeNode
Auto Trait Implementations§
impl Freeze for DataTypeNode
impl RefUnwindSafe for DataTypeNode
impl Send for DataTypeNode
impl Sync for DataTypeNode
impl Unpin for DataTypeNode
impl UnwindSafe for DataTypeNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more