Expand description
Database schema and ORM for zino.
§Supported database drivers
The following optional features are available:
| Feature flag | Description | Default? |
|---|---|---|
orm-mariadb | Enables the MariaDB database driver. | No |
orm-mysql | Enables the MySQL database driver. | No |
orm-postgres | Enables the PostgreSQL database driver. | No |
orm-sqlite | Enables the SQLite database driver. | No |
orm-tidb | Enables the TiDB database driver. | No |
§Mappings of Rust data types
| Rust type | MySQL datatype | PostgreSQL datatype | SQLite datatype |
|---|---|---|---|
bool | BOOLEAN | BOOLEAN | BOOLEAN |
i8 | TINYINT | SMALLINT | INTEGER |
u8 | TINYINT UNSIGNED | SMALLINT | INTEGER |
i16 | SMALLINT | SMALLINT | INTEGER |
u16 | SMALLINT UNSIGNED | SMALLINT | INTEGER |
i32, Option<i32> | INT | INT, SERIAL | INTEGER |
u32, Option<u32> | INT UNSIGNED | INT, SERIAL | INTEGER |
i64, Option<i64>, isize | BIGINT | BIGINT, BIGSERIAL | INTEGER |
u64, Option<u64>, usize | BIGINT UNSIGNED | BIGINT, BIGSERIAL | INTEGER |
f32 | FLOAT | REAL | REAL |
f64 | DOUBLE | DOUBLE PRECISION | REAL |
Decimal | NUMERIC | NUMERIC | TEXT |
String, Option<String> | TEXT, VARCHAR(255) | TEXT | TEXT |
Date, NaiveDate | DATE | DATE | DATE |
Time, NaiveTime | TIME | TIME | TIME |
DateTime | TIMESTAMP(6) | TIMESTAMPTZ | DATETIME |
NaiveDateTime | DATETIME(6) | TIMESTAMP | DATETIME |
Uuid, Option<Uuid> | CHAR(36), UUID | UUID | TEXT |
Vec<u8> | BLOB | BYTEA | BLOB |
Vec<i32>, Vec<u32> | JSON | INT[] | TEXT |
Vec<i64>, Vec<u64> | JSON | BIGINT[] | TEXT |
Vec<String> | JSON | TEXT[] | TEXT |
Vec<UUID> | JSON | UUID[] | TEXT |
Map | JSON | JSONB | TEXT |
Structs§
- A database connection pool with metadata.
- Global access to the shared connection pools.
- SQL joins on two tables.
- A mutation builder for the model entity.
- A query builder for the model entity.
- SQL window functions.
Enums§
- SQL aggregate functions.
Traits§
- A collection of values that can be decoded from a single row.
- Encodes the column to be sent to the database.
- An interface for the model entity.
- Executing queries against the database.
- A generic interface for converting into SQL values.
- Access model fields.
- Helper utilities for models.
- A manager of the connection pool.
- Scalar
Query orm-sqlxQuery on scalar values. - Database schema.
- An in-progress database transaction.
Functions§
- decode
orm-sqlxDecodes a single value asTfor the field in a row. - decode_
array orm-sqlxDecodes a single value asVec<T>for the field in a row. - decode_
decimal orm-sqlxDecodes a single value asDecimalfor the field in a row. - decode_
optional orm-sqlxDecodes a single value asTfor the field in a row, returningNoneif it was not found. - decode_
uuid orm-sqlxDecodes a single value asUuidfor the field in a row.
Type Aliases§
- SQLite database connection.
- SQLite database driver.
- SQLite database pool.
- A single row from the SQLite database.