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

This is supported on feature="mysql" only.

Conversions between Rust and MySQL types.

Types

Rust typeMySQL type(s)
boolTINYINT(1)
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>TIMETAMP
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

Nullable

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