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
41
42
43
//! Database support: driver selection, and the Postgres migration-governance
//! runtime.
//!
//! # Driver selection lives here, not in an application
//!
//! `KRAB_DB_DRIVER=postgres|sqlite` is presented as a framework-level choice,
//! but the enum that parsed it, the default connection strings, and the pool
//! wrapper all lived in `services/service_users` — a reference application. A
//! consumer depending on `krab_core` got Postgres and nothing else, and had to
//! reimplement driver selection or copy it out of an example. [`DbDriver`] and
//! [`resolve_db_driver`] are the framework's answer to that.
//!
//! # Feature layout
//!
//! | Feature | Enables |
//! |---|---|
//! | `db-postgres` | [`postgres`] — connection, migrations, drift, rollback, promotion policy |
//! | `db-sqlite` | `sqlx`'s SQLite driver, for applications building their own repositories |
//!
//! The `db` alias for `db-postgres`, deprecated since 0.2.0, was removed in 0.6.0.
//!
//! Driver selection is available whenever *either* driver feature is on, since
//! choosing between them is the point.
//!
//! [`postgres`]'s items are re-exported at this level, so `krab_core::db::connect`,
//! `krab_core::db::DbPool`, and the rest resolve unchanged under `db-postgres`.
//!
//! Migration governance — checksums, drift detection, rollback rehearsal — is
//! Postgres-only and stays that way. SQLite is supported as a development and
//! embedded target; it does not carry the same governance guarantees. See
//! [`docs/reference/database.md`](https://github.com/ManirajKatuwal/krab-pub/blob/main/docs/reference/database.md).
pub use ;
// Flattened so every pre-existing `krab_core::db::*` path keeps resolving.
// Splitting the feature should not have been a breaking change for callers
// that only ever used Postgres.
pub use *;