Crate zino_orm

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<f32>JSONREAL[]TEXT
Vec<f64>JSONDOUBLE PRECISION[]TEXT
Vec<String>JSONTEXT[]TEXT
Vec<UUID>JSONUUID[]TEXT
MapJSONJSONBTEXT

Structs§

ConnectionPool
A database connection pool with metadata.
DerivedColumn
A column computed dynamically based on other columns or expressions.
GlobalPool
Global access to the shared connection pools.
JoinOn
SQL joins on two tables.
MutationBuilder
A mutation builder for the model entity.
QueryBuilder
A query builder for the model entity.
Window
SQL window functions.

Enums§

Aggregation
SQL aggregate expressions.

Traits§

DecodeRow
A collection of values that can be decoded from a single row.
EncodeColumn
Encoding a column to be sent to the database.
Entity
An interface for the model entity.
Executor
Executing queries against the database.
IntoSqlValue
A generic interface for converting into SQL values.
ModelAccessor
Access model fields.
ModelColumn
An interface for the model column.
ModelHelper
Helper utilities for models.
PoolManager
A manager of the connection pool.
PrimaryKey
An interface for the primary key.
ScalarQueryorm-sqlx
Query on scalar values.
Schema
Database schema.
Transaction
An in-progress database transaction.

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.
decode_decimalorm-sqlx
Decodes a single value as Decimal for the field in a row.
decode_optionalorm-sqlx
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§

DatabaseConnection
SQLite database connection.
DatabaseDriver
SQLite database driver.
DatabasePool
SQLite database pool.
DatabaseRow
A single row from the SQLite database.