Module sqlx::mysql::types[][src]

This is supported on crate feature mysql only.
Expand description

Conversions between Rust and MySQL types.

Types

Rust typeMySQL type(s)
boolTINYINT(1), BOOLEAN
i8TINYINT
i16SMALLINT
i32INT
i64BIGINT
u8TINYINT UNSIGNED
u16SMALLINT UNSIGNED
u32INT UNSIGNED
u64BIGINT UNSIGNED
f32FLOAT
f64DOUBLE
&str, StringVARCHAR, CHAR, TEXT
&[u8], Vec<u8>VARBINARY, BINARY, BLOB

chrono

Requires the chrono Cargo feature flag.

Rust typeMySQL type(s)
chrono::DateTime<Utc>TIMESTAMP
chrono::DateTime<Local>TIMESTAMP
chrono::NaiveDateTimeDATETIME
chrono::NaiveDateDATE
chrono::NaiveTimeTIME

time

Requires the time Cargo feature flag.

Rust typeMySQL type(s)
time::PrimitiveDateTimeDATETIME
time::OffsetDateTimeTIMESTAMP
time::DateDATE
time::TimeTIME

bigdecimal

Requires the bigdecimal Cargo feature flag.

Rust typeMySQL type(s)
bigdecimal::BigDecimalDECIMAL

decimal

Requires the decimal Cargo feature flag.

Rust typeMySQL type(s)
rust_decimal::DecimalDECIMAL

uuid

Requires the uuid Cargo feature flag.

Rust typeMySQL type(s)
uuid::UuidBYTE(16), VARCHAR, CHAR, TEXT
uuid::adapter::HyphenatedCHAR(36)

json

Requires the json Cargo feature flag.

Rust typeMySQL type(s)
json::JsonValueJSON

Nullable

In addition, Option<T> is supported where T implements Type. An Option<T> represents a potentially NULL value from MySQL.