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 bb8_postgres::PostgresConnectionManager;
Creates a connection pool and executes a simple query.
use bb8_postgres::{bb8, PostgresConnectionManager};
use tokio_postgres::NoTls;
#[tokio::main]
async fn main() {
let manager = PostgresConnectionManager::new_from_stringlike(
"host=localhost user=postgres dbname=mydb",
NoTls,
).unwrap();
let pool = bb8::Pool::builder().build(manager).await.unwrap();
let conn = pool.get().await.unwrap();
let row = conn.query_one("SELECT 1", &[]).await.unwrap();
println!("Result: {}", row.get::<_, i32>(0));
}
Audit
Dependencies
No dependency data recorded yet.