3 releases
Uses new Rust 2024
| new 0.3.2 | Dec 24, 2025 |
|---|---|
| 0.3.1 | Dec 21, 2025 |
| 0.3.0 | Dec 21, 2025 |
#1699 in Database interfaces
Used in 4 crates
1MB
21K
SLoC
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
Example
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(())
}
prax-postgres
PostgreSQL query engine for Prax ORM.
Overview
prax-postgres provides an async PostgreSQL backend using tokio-postgres with deadpool-postgres connection pooling.
Features
- Async query execution with Tokio
- Connection pooling via deadpool-postgres
- Transaction support with savepoints
- Prepared statement caching
- SSL/TLS support
Usage
use prax_postgres::PostgresEngine;
let engine = PostgresEngine::new("postgresql://user:pass@localhost/db").await?;
// Execute queries through Prax client
let client = PraxClient::with_engine(engine);
let users = client.user().find_many().exec().await?;
Configuration
use prax_query::connection::PoolConfig;
let config = PoolConfig::new()
.max_connections(20)
.min_connections(5)
.idle_timeout(Duration::from_secs(300));
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Dependencies
~17–34MB
~390K SLoC