Registry / database / r2d2-postgres

r2d2-postgres

JSON →
library0.18.2rscratesunverified

Provides a connection pool manager for PostgreSQL using the r2d2 pool and postgres crate.

# Cargo.toml [dependencies] r2d2_postgres = "0.18.2"
INSTALL
IMPORT
SIG · R2D2-POSTGRES
R
r2d2-postgres
databaserustv0.18.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PostgresConnectionManager
use r2d2_postgres::PostgresConnectionManager;

Creates a PostgreSQL connection pool and retrieves a connection.

use r2d2_postgres::{PostgresConnectionManager, r2d2}; use postgres::NoTls; let manager = PostgresConnectionManager::new( "host=localhost user=postgres".parse().unwrap(), NoTls, ); let pool = r2d2::Pool::builder().build(manager).unwrap(); let conn = pool.get().unwrap(); println!("Connected to PostgreSQL");
Debug
Known issues
gotchaRequires the `postgres` crate and a running PostgreSQL server; TLS setup may need additional features.
fix
Enable the `with-tls` feature for TLS support, or use `NoTls` for plain connections.
affects: >=0.18.0
Upgrade
Version history
0.18.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
r2d2-postgres — cargo add r2d2-postgres · libregistry