Expand description
The sqlx adapter for fastauth: Postgres and SQLite,
with migrations. See docs/06-database.md.
use fastauth_sqlx::{Sqlx, SqlitePool};
let pool = SqlitePool::connect("sqlite://acme.db?mode=rwc").await?;
let db = Sqlx::new(pool).table_prefix("fa_"); // Sqlx<Sqlite>Re-exports§
pub use sqlx;
Structs§
- Pool
- An asynchronous pool of SQLx database connections.
- Postgres
- PostgreSQL database driver.
- Shared
Tx - An app’s sqlx transaction that fastauth server API calls can join with
InTx::in_tx. The rows those calls write commit or roll back with the app’s own, and their events fire aftercommit, never on rollback. - Sqlite
- Sqlite database driver.
- Sqlx
- The fastauth adapter over a sqlx pool.
Sqlx::new(pool)infers the database from the pool: aPgPoolgivesSqlx<Postgres>, aSqlitePoolgivesSqlx<Sqlite>. - SqlxTx
- A transaction from
Adapter::begin: a new one on a pool connection, or a savepoint when the adapter is bound to an app transaction. Dropping it withoutcommitrolls back.
Traits§
- Dialect
- A database this crate supports:
PostgresorSqlite, each behind the feature of the same name. Sealed. - InTx
auth.api().in_tx(&tx): server API calls on an app’sSharedTx.
Type Aliases§
- PgPool
- An alias for
Pool, specialized for Postgres. - Sqlite
Pool - An alias for
Pool, specialized for SQLite.