sea_query::table

Enum ColumnType

source
#[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

ColumnTypeMySQL data typePostgreSQL data typeSQLite data type
Charcharcharchar
Stringvarcharvarcharvarchar
Texttexttexttext
TinyIntegertinyintsmallinttinyint
SmallIntegersmallintsmallintsmallint
Integerintintegerinteger
BigIntegerbigintbigintinteger
TinyUnsignedtinyint unsignedsmallinttinyint
SmallUnsignedsmallint unsignedsmallintsmallint
Unsignedint unsignedintegerinteger
BigUnsignedbigint unsignedbigintinteger
Floatfloatrealfloat
Doubledoubledouble precisiondouble
Decimaldecimaldecimalreal
DateTimedatetimetimestamp without time zonedatetime_text
Timestamptimestamptimestamptimestamp_text
TimestampWithTimeZonetimestamptimestamp with time zonetimestamp_with_timezone_text
Timetimetimetime_text
Datedatedatedate_text
YearyearN/AN/A
IntervalN/AintervalN/A
Blobblobbyteablob
Binarybinarybyteablob
VarBinaryvarbinarybyteavarbinary_blob
BitbitbitN/A
VarBitbitvarbitN/A
Booleanboolboolboolean
Moneydecimalmoneyreal_money
Jsonjsonjsonjson_text
JsonBinaryjsonjsonbjsonb_text
Uuidbinary(16)uuiduuid_text
EnumENUM(โ€ฆ)ENUM_NAMEenum_text
ArrayN/ADATA_TYPE[]N/A
VectorN/AvectorN/A
CidrN/AcidrN/A
InetN/AinetN/A
MacAddrN/AmacaddrN/A
LTreeN/AltreeN/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

Fields

ยงvariants: Vec<DynIden>
ยง

Array(RcOrArc<ColumnType>)

ยง

Vector(Option<u32>)

ยง

Cidr

ยง

Inet

ยง

MacAddr

ยง

LTree

Implementationsยง

sourceยง

impl ColumnType

source

pub fn custom<T>(ty: T) -> ColumnType
where T: Into<String>,

source

pub fn string(length: Option<u32>) -> ColumnType

source

pub fn var_binary(length: u32) -> ColumnType

Trait Implementationsยง

sourceยง

impl Clone for ColumnType

sourceยง

fn clone(&self) -> ColumnType

Returns a copy of the value. Read more
1.0.0 ยท sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
sourceยง

impl Debug for ColumnType

sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
sourceยง

impl PartialEq for ColumnType

sourceยง

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท sourceยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementationsยง

Blanket Implementationsยง

sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
sourceยง

impl<T> CloneToUninit for T
where T: Clone,

sourceยง

unsafe fn clone_to_uninit(&self, dst: *mut T)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
sourceยง

impl<T> From<T> for T

sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

sourceยง

impl<T> ToOwned for T
where T: Clone,

sourceยง

type Owned = T

The resulting type after obtaining ownership.
sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.