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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// QueryError is intentionally large; see prax-query/src/lib.rs.
//! # prax-postgres
//!
//! PostgreSQL driver for the Prax ORM with connection pooling and prepared statement caching.
//!
//! This crate provides:
//! - Connection pool management using `deadpool-postgres`
//! - Prepared statement caching for improved performance
//! - Type-safe parameter binding
//! - Row deserialization into Prax models
//! - [`PgListener`]: `LISTEN` / `NOTIFY` on a dedicated, auto-reconnecting
//! connection, with `PgConnection::notify` / `PgTransaction::notify` for
//! sending (any role can `NOTIFY` any channel, so treat payloads as
//! untrusted)
//! - Pool recycling policy ([`PgRecycling`]: `Fast` (default), `Verified`,
//! `Clean`), bounded by `PoolConfig::recycle_timeout`, plus jittered
//! `max_lifetime` retirement. `Fast` keeps session state (`SET ROLE`,
//! `search_path`, tenant GUCs) across checkouts; use `Clean` when that
//! matters
//! - Row locking (`FOR UPDATE` / `FOR SHARE`, `SKIP LOCKED`, `NOWAIT`,
//! `OF`) through [`PgEngine`] and `prax_query`'s `.lock(RowLock)`; `OF`
//! table names must be plain identifiers
//! - Typed array binding for `FilterValue::Array` (use `= ANY($1)`) and raw
//! `bytea` for `FilterValue::Bytes`
//!
//! ## Example
//!
//! ```rust,ignore
//! use prax_postgres::PgPool;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a connection pool
//! let pool = PgPool::builder()
//! .url("postgresql://user:pass@localhost/db")
//! .max_connections(10)
//! .build()
//! .await?;
//!
//! // Get a connection
//! let conn = pool.get().await?;
//!
//! Ok(())
//! }
//! ```
pub
pub
pub
pub use ;
pub use PgConnection;
pub use PgEngine;
pub use ;
pub use ;
pub use ;
pub use PgRow;
pub use PreparedStatementCache;
/// Prelude for convenient imports.