Re-exportsยง
pub extern crate sqlx;
Modulesยง
- db ๐
- migrate ๐
- queries ๐
- Immutable query functionality of a SQL database.
- syntax_
helpers - testing
- transaction ๐
- SQL transactions
Macrosยง
- include_
dir - Embed the contents of a directory in your crate.
- include_
migrations - Embed migrations from the given directory into the current binary for PostgreSQL or SQLite.
Structsยง
- Backfill
- Marker type indicating a transaction used for deferred-migration batches.
- Config
- Error
- The
Errortype, a wrapper around a dynamic error type. - Migration
- Represents a schema migration to be run on the database,
this struct is used by the
embed_migrations!macro to gather migration files and shouldnโt be needed by the user - Prune
- Marker type indicating a transaction used for pruning deletes.
- Prune
State ๐ - Pruner
- Query
Builder - Helper type for programmatically constructing queries.
- Read
- Marker type indicating a transaction with read-only access to the database.
- Serializable
Retry Config - Retry policy for transactions aborted by PostgreSQL serialization conflicts (SQLSTATE 40001).
- SqlStorage
- Storage for the APIs provided in this crate, backed by a remote PostgreSQL database.
- Sqlite
- Sqlite database driver.
- Transaction
- An atomic SQL transaction.
- Write
- Marker type indicating a transaction with read-write access to the database.
Enumsยง
Traitsยง
- Database
- A database driver.
- Executor
- A type that contains or can provide a database connection to use for executing queries against the database.
- Fixed
Length Params - A collection of parameters with a statically known length.
- Params
- A collection of parameters which can be bound to a SQL query.
- Transaction
Mode - Trait for marker types indicating what type of access a transaction has to the database.
Functionsยง
- add_
custom_ ๐migrations - Add custom migrations to a default migration sequence.
- build_
where_ in - default_
migrations - The migrations required to build the default schema for this version of
SqlStorage. - is_
serialization_ ๐conflict_ err - Returns
trueiferrโsDisplayoutput identifies it as a PostgreSQL serialization conflict (SQLSTATE 40001, message โcould not serialize accessโ). - query
- query_
as - serialization_
conflict_ ๐with_ diag - Like
is_serialization_conflict_errbut also logs concurrent DB sessions for diagnostics. - set_
no_ deferrable_ on_ read - Configure whether read transactions on Postgres should omit
DEFERRABLE. - spawn_
pg_ ๐stat_ activity_ log - Spawn a background task that queries
pg_stat_activityandpg_locksto identify the connections and predicate locks involved in a serialization conflict, logging them atwarn. - validate_
migrations ๐ - Validate and preprocess a sequence of migrations.