Available on crate feature
db only.Expand description
Database support along with migration engine and ORM.
This module contains the database connection structure, the model trait, and the error types that can occur when interacting with the database.
Modules§
- impl_
mysql mysql - Database interface implementation – MySQL backend.
- impl_
postgres postgres - Database interface implementation – PostgreSQL backend.
- impl_
sqlite sqlite - Database interface implementation – SQLite backend.
- migrations
- Database migrations.
- query
- Database query builder.
Macros§
Structs§
- Column
- A column structure that holds the name of the column and some additional schema information.
- Database
- A database connection structure that holds the connection to the database.
- Identifier
- An identifier structure that holds table or column name as a string.
- Limited
String - A wrapper over a string that has a limited length.
- NewLimited
String Error - An error returned by
LimitedString::newwhen the string is longer than the specified limit. - RowsNum
- A structure that holds the number of rows.
- Statement
Result - Result of a statement execution.
Enums§
- Auto
- A wrapper over a value that can be either a fixed value or be automatically generated by the database.
- Column
Type - A type that represents a column type in the database.
- Database
Error - An error that can occur when interacting with the database.
- DbField
Value - Represents a value for a field in the database.
- Foreign
Key - A foreign key to another model.
- Foreign
KeyOn Delete Policy - A foreign key on delete constraint.
- Foreign
KeyOn Update Policy - A foreign key on update constraint.
- Row
- A row structure that holds the data of a single row retrieved from the database.
Traits§
- Database
Backend - A trait that provides a backend for the database.
- Database
Field - A trait denoting that some type can be used as a field in a database.
- From
DbValue - A trait for converting a database value to a Rust value.
- Model
- A model trait for database models.
- Primary
Key - A marker trait that denotes that a type can be used as a primary key in a database.
- Sqlx
Value Ref - A trait for accessing raw database values from a specific database backend. This provides low-level access to database-specific value references.
- ToDb
Field Value - A generalization of
ToDbValuethat can also return a marker that means a value should be automatically generated by the database. - ToDb
Value - A trait for converting a Rust value to a database value.
Type Aliases§
- DbValue
- An alias for the value type internally used by the
sea_querycrate. - Result
- An alias for
Resultthat usesDatabaseErroras the error type.