pub enum DataType {
Show 24 variants
Char(Option<u64>),
Varchar,
Uuid,
Decimal(Option<u64>, Option<u64>),
Float(Option<u64>),
SmallInt,
Int,
BigInt,
Real,
Double,
Boolean,
Date,
Time(bool),
Timestamp(bool),
Interval,
Regclass,
Regproc,
Text,
Bytea,
Jsonb,
Custom(ObjectName),
Array(Box<DataType>),
Struct(Vec<StructField>),
Map(Box<(DataType, DataType)>),
}
Expand description
SQL data types
Variants§
Char(Option<u64>)
Fixed-length character type e.g. CHAR(10)
Varchar
Variable-length character type. We diverge from postgres by disallowing Varchar(n).
Uuid
Uuid type
Decimal(Option<u64>, Option<u64>)
Decimal type with optional precision and scale e.g. DECIMAL(10,2)
Float(Option<u64>)
Floating point with optional precision e.g. FLOAT(8)
SmallInt
SMALLINT (int2)
Int
INTEGER (int4)
BigInt
BIGINT (int8)
Real
Floating point e.g. REAL
Double
Double e.g. DOUBLE PRECISION
Boolean
Boolean
Date
Date
Time(bool)
Time with optional time zone
Timestamp(bool)
Timestamp with optional time zone
Interval
Interval
Regclass
Regclass used in postgresql serial
Regproc
Regproc used in postgresql function
Text
Text
Bytea
Bytea
Jsonb
JSONB
Custom(ObjectName)
Custom type such as enums
Array(Box<DataType>)
Arrays
Struct(Vec<StructField>)
Structs
Map(Box<(DataType, DataType)>)
Map(key_type, value_type)
Trait Implementations§
impl Eq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more