prax_postgres/lib.rs
1//! # prax-postgres
2//!
3//! PostgreSQL driver for the Prax ORM with connection pooling and prepared statement caching.
4//!
5//! This crate provides:
6//! - Connection pool management using `deadpool-postgres`
7//! - Prepared statement caching for improved performance
8//! - Type-safe parameter binding
9//! - Row deserialization into Prax models
10//!
11//! ## Example
12//!
13//! ```rust,ignore
14//! use prax_postgres::PgPool;
15//!
16//! #[tokio::main]
17//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
18//! // Create a connection pool
19//! let pool = PgPool::builder()
20//! .url("postgresql://user:pass@localhost/db")
21//! .max_connections(10)
22//! .build()
23//! .await?;
24//!
25//! // Get a connection
26//! let conn = pool.get().await?;
27//!
28//! Ok(())
29//! }
30//! ```
31
32pub mod config;
33pub mod connection;
34pub mod deserialize;
35pub mod engine;
36pub mod error;
37pub mod pool;
38pub mod row;
39pub mod row_ref;
40pub mod statement;
41pub mod types;
42
43pub use config::{PgConfig, PgConfigBuilder};
44pub use connection::PgConnection;
45pub use engine::PgEngine;
46pub use error::{PgError, PgResult};
47pub use pool::{PgPool, PgPoolBuilder, PoolConfig, PoolStatus};
48pub use row::PgRow;
49pub use statement::PreparedStatementCache;
50
51/// Prelude for convenient imports.
52pub mod prelude {
53 pub use crate::config::{PgConfig, PgConfigBuilder};
54 pub use crate::connection::PgConnection;
55 pub use crate::engine::PgEngine;
56 pub use crate::error::{PgError, PgResult};
57 pub use crate::pool::{PgPool, PgPoolBuilder};
58 pub use crate::row::PgRow;
59}