1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Compile-time-selected sqlx pool aliases — the one place the backend
//! (`sqlite` vs `postgres`) is chosen.
//!
//! Enable exactly one of the `sqlite` or `postgres` features. Both the arium
//! auth engine and `arium-authz` depend on this crate, so they agree on a
//! single concrete `Pool` type and a single "exactly one backend" guard:
//! a feature-unification mistake fails here, loudly, rather than as a cryptic
//! `SqlitePool`-vs-`PgPool` mismatch deep in a transaction signature.
compile_error!;
compile_error!;
/// The sqlx connection pool arium runs every query against. Resolves to
/// `SqlitePool` or `PgPool` depending on which backend feature is active.
pub type Pool = SqlitePool;
/// The sqlx connection pool arium runs every query against. Resolves to
/// `SqlitePool` or `PgPool` depending on which backend feature is active.
pub type Pool = PgPool;
/// The sqlx [`Database`](sqlx::Database) arium is compiled against — `Sqlite`
/// or `Postgres`. Used where a concrete backend type is unavoidable, e.g. the
/// transaction handle threaded through `arium_authz::membership::TxExec`.
pub type DbBackend = Sqlite;
/// The sqlx [`Database`](sqlx::Database) arium is compiled against — `Sqlite`
/// or `Postgres`. Used where a concrete backend type is unavoidable, e.g. the
/// transaction handle threaded through `arium_authz::membership::TxExec`.
pub type DbBackend = Postgres;
/// The backend's connection type (`SqliteConnection` / `PgConnection`). A
/// `&mut DbConnection` is an sqlx [`Executor`](sqlx::Executor); the membership
/// layer's `TxExec` derefs to it so store impls run queries with the familiar
/// `&mut *tx`.
pub type DbConnection = Connection;