Module models::types [−][src]
Expand description
Types
Rust | PostgreSQL | MySQL | SQLite |
---|---|---|---|
bool | BOOLEAN | BOOLEAN | BOOLEAN |
i8 | SMALLINT | TINYINT | INTEGER |
i16 | SMALLINT | SMALLINT | INTEGER |
i32 | INT | INT | INTEGER |
i64 | BIGINT | BIGINT | INTEGER |
f32 | REAL | FLOAT | REAL |
f64 | REAL | REAL | REAL |
String | TEXT | TEXT | TEXT |
VarChar<SIZE> | VARCHAR(SIZE) | VARCHAR(SIZE) | TEXT |
VarBinary<SIZE> | BYTEA | VARBINARY(SIZE) | BLOB |
Vec<u8> | BYTEA | BLOB | BLOB |
[u8; SIZE] | BYTEA | BLOB(SIZE) | BLOB |
chrono
Requires the chrono
Cargo feature flag.
Rust type | Postgres | MySQL | SQLite |
---|---|---|---|
chrono::DateTime<Utc> | TIMESTAMPTZ | TIMESTAMP | DATETIME |
chrono::DateTime<Local> | TIMESTAMPTZ | TIMESTAMP | DATETIME |
chrono::NaiveDateTime | TIMESTAMP | DATETIME | DATETIME |
chrono::NaiveDate | DATE | DATE | DATETIME |
chrono::NaiveTime | TIME | TIME | DATETIME |
Structs
Wrapper type that defaults to DATE
.
Wrapper type that defaults to DATETIME
.
PostgreSQL SERIAL
type. It enables autoincrementing functionality.
Example:
Wrapper type that defaults to TIMESTAMP
.
Used for MySQL when to specify that the datatype should be
a VARBINARY(N)
. The database will make sure the field does not
go over the specified length.
Used for MySQL when to specify that the datatype should be
a VARCHAR(N)
. The database will make sure the field does not
go over the specified length.
Traits
Do not use this trait in your production code. Its intended use is for migration generation only. It will panic if used outside its intended API.