Crate zino_orm

Source
Expand description

github crates-io docs-rs

Database schema and ORM for zino.

§Supported database drivers

The following optional features are available:

Feature flagDescriptionDefault?
orm-mariadbEnables the MariaDB database driver.No
orm-mysqlEnables the MySQL database driver.No
orm-postgresEnables the PostgreSQL database driver.No
orm-sqliteEnables the SQLite database driver.No
orm-tidbEnables the TiDB database driver.No

§Mappings of Rust data types

Rust typeMySQL datatypePostgreSQL datatypeSQLite datatype
boolBOOLEANBOOLEANBOOLEAN
i8TINYINTSMALLINTINTEGER
u8TINYINT UNSIGNEDSMALLINTINTEGER
i16SMALLINTSMALLINTINTEGER
u16SMALLINT UNSIGNEDSMALLINTINTEGER
i32, Option<i32>INTINT, SERIALINTEGER
u32, Option<u32>INT UNSIGNEDINT, SERIALINTEGER
i64, Option<i64>, isizeBIGINTBIGINT, BIGSERIALINTEGER
u64, Option<u64>, usizeBIGINT UNSIGNEDBIGINT, BIGSERIALINTEGER
f32FLOATREALREAL
f64DOUBLEDOUBLE PRECISIONREAL
DecimalNUMERICNUMERICTEXT
String, Option<String>TEXT, VARCHAR(255)TEXTTEXT
Date, NaiveDateDATEDATEDATE
Time, NaiveTimeTIMETIMETIME
DateTimeTIMESTAMP(6)TIMESTAMPTZDATETIME
NaiveDateTimeDATETIME(6)TIMESTAMPDATETIME
Uuid, Option<Uuid>CHAR(36), UUIDUUIDTEXT
Vec<u8>BLOBBYTEABLOB
Vec<i32>, Vec<u32>JSONINT[]TEXT
Vec<i64>, Vec<u64>JSONBIGINT[]TEXT
Vec<String>JSONTEXT[]TEXT
Vec<UUID>JSONUUID[]TEXT
MapJSONJSONBTEXT

Structs§

Enums§

Traits§

Functions§

  • decodeorm-sqlx
    Decodes a single value as T for the field in a row.
  • decode_arrayorm-sqlx
    Decodes a single value as Vec<T> for the field in a row.
  • Decodes a single value as Decimal for the field in a row.
  • Decodes a single value as T for the field in a row, returning None if it was not found.
  • decode_uuidorm-sqlx
    Decodes a single value as Uuid for the field in a row.

Type Aliases§