#[non_exhaustive]pub enum ColumnType {
Show 39 variants
Char(Option<u32>),
String(StringLen),
Text,
Blob,
TinyInteger,
SmallInteger,
Integer,
BigInteger,
TinyUnsigned,
SmallUnsigned,
Unsigned,
BigUnsigned,
Float,
Double,
Decimal(Option<(u32, u32)>),
DateTime,
Timestamp,
TimestampWithTimeZone,
Time,
Date,
Year,
Interval(Option<PgInterval>, Option<u32>),
Binary(u32),
VarBinary(StringLen),
Bit(Option<u32>),
VarBit(u32),
Boolean,
Money(Option<(u32, u32)>),
Json,
JsonBinary,
Uuid,
Custom(DynIden),
Enum {
name: DynIden,
variants: Vec<DynIden>,
},
Array(RcOrArc<ColumnType>),
Vector(Option<u32>),
Cidr,
Inet,
MacAddr,
LTree,
}
Expand description
All column types
ColumnType | MySQL data type | PostgreSQL data type | SQLite data type |
---|---|---|---|
Char | char | char | char |
String | varchar | varchar | varchar |
Text | text | text | text |
TinyInteger | tinyint | smallint | tinyint |
SmallInteger | smallint | smallint | smallint |
Integer | int | integer | integer |
BigInteger | bigint | bigint | integer |
TinyUnsigned | tinyint unsigned | smallint | tinyint |
SmallUnsigned | smallint unsigned | smallint | smallint |
Unsigned | int unsigned | integer | integer |
BigUnsigned | bigint unsigned | bigint | integer |
Float | float | real | float |
Double | double | double precision | double |
Decimal | decimal | decimal | real |
DateTime | datetime | timestamp without time zone | datetime_text |
Timestamp | timestamp | timestamp | timestamp_text |
TimestampWithTimeZone | timestamp | timestamp with time zone | timestamp_with_timezone_text |
Time | time | time | time_text |
Date | date | date | date_text |
Year | year | N/A | N/A |
Interval | N/A | interval | N/A |
Blob | blob | bytea | blob |
Binary | binary | bytea | blob |
VarBinary | varbinary | bytea | varbinary_blob |
Bit | bit | bit | N/A |
VarBit | bit | varbit | N/A |
Boolean | bool | bool | boolean |
Money | decimal | money | real_money |
Json | json | json | json_text |
JsonBinary | json | jsonb | jsonb_text |
Uuid | binary(16) | uuid | uuid_text |
Enum | ENUM(โฆ) | ENUM_NAME | enum_text |
Array | N/A | DATA_TYPE[] | N/A |
Vector | N/A | vector | N/A |
Cidr | N/A | cidr | N/A |
Inet | N/A | inet | N/A |
MacAddr | N/A | macaddr | N/A |
LTree | N/A | ltree | N/A |
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.
Char(Option<u32>)
String(StringLen)
Text
Blob
TinyInteger
SmallInteger
Integer
BigInteger
TinyUnsigned
SmallUnsigned
Unsigned
BigUnsigned
Float
Double
Decimal(Option<(u32, u32)>)
DateTime
Timestamp
TimestampWithTimeZone
Time
Date
Year
Interval(Option<PgInterval>, Option<u32>)
Binary(u32)
VarBinary(StringLen)
Bit(Option<u32>)
VarBit(u32)
Boolean
Money(Option<(u32, u32)>)
Json
JsonBinary
Uuid
Custom(DynIden)
Enum
Array(RcOrArc<ColumnType>)
Vector(Option<u32>)
Cidr
Inet
MacAddr
LTree
Implementationsยง
sourceยงimpl ColumnType
impl ColumnType
pub fn custom<T>(ty: T) -> ColumnType
pub fn string(length: Option<u32>) -> ColumnType
pub fn var_binary(length: u32) -> ColumnType
Trait Implementationsยง
sourceยงimpl Clone for ColumnType
impl Clone for ColumnType
sourceยงfn clone(&self) -> ColumnType
fn clone(&self) -> ColumnType
Returns a copy 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 ColumnType
impl Debug for ColumnType
sourceยงimpl PartialEq for ColumnType
impl PartialEq for ColumnType
Auto Trait Implementationsยง
impl Freeze for ColumnType
impl !RefUnwindSafe for ColumnType
impl Send for ColumnType
impl Sync for ColumnType
impl Unpin for ColumnType
impl !UnwindSafe for ColumnType
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
)