Enum ColumnType
#[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(SeaRc<dyn Iden>),
Enum {
name: SeaRc<dyn Iden>,
variants: Vec<SeaRc<dyn Iden>>,
},
Array(Arc<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(SeaRc<dyn Iden>)
Enum
Array(Arc<ColumnType>)
Vector(Option<u32>)
Cidr
Inet
MacAddr
LTree
Implementations§
§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§
§impl Clone for ColumnType
impl Clone for ColumnType
§fn clone(&self) -> ColumnType
fn clone(&self) -> ColumnType
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 more§impl ColumnTypeTrait for ColumnType
impl ColumnTypeTrait for ColumnType
§impl Debug for ColumnType
impl Debug for ColumnType
§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§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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,
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any.§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].