Enum sea_query::table::ColumnType

source ·
#[non_exhaustive]
pub enum ColumnType {
Show 37 variants Char(Option<u32>), String(StringLen), Text, 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>), 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
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
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

§

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>)

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> 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,

§

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>,

§

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>,

§

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.