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
44
45
//! PostgreSQL persistence layer: connection setup, SeaORM entities, and
//! repositories.
//!
//! This module owns the database boundary. [`create_connection`](crate::db::create_connection) builds
//! a pooled [`DatabaseConnection`](sea_orm::DatabaseConnection) from [`DatabaseConfig`](crate::config::DatabaseConfig). Submodules:
//! [`models`](crate::db::models) holds the SeaORM entity definitions, [`schema`](crate::db::schema) the table
//! definitions, [`repositories`](crate::db::repositories) the data-access traits and their SeaORM
//! implementations ([`PersonRepository`](crate::db::repositories::PersonRepository) / [`SeaOrmPersonRepository`](crate::db::repositories::SeaOrmPersonRepository)),
//! and [`audit`](crate::db::audit) the HIPAA-style [`AuditLogRepository`](crate::db::audit::AuditLogRepository). The key traits
//! and types are re-exported here for convenience.
use ;
use crateDatabaseConfig;
use crateResult;
/// Table/column schema definitions.
/// SeaORM entity (ActiveModel/Model) definitions.
/// Repository traits and their SeaORM implementations.
/// jiff <-> time conversions at the persistence boundary.
/// Audit-log repository for the HIPAA-style trail.
pub use ;
pub use AuditLogRepository;
/// Open a pooled PostgreSQL connection from the given configuration.
///
/// Applies the configured min/max pool sizes. Connection errors are
/// mapped to [`crate::Error::Pool`]. The returned
/// [`DatabaseConnection`] is cheap to clone and is shared across
/// handlers via [`AppState`](crate::api::rest::state::AppState).
pub async