r2d2_postgres 0.8.0

Postgres support for the r2d2 connection pool
docs.rs failed to build r2d2_postgres-0.8.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: r2d2_postgres-0.18.1

r2d2-postgres

Build Status

rust-postgres support library for the r2d2 connection pool.

Documentation is available at https://sfackler.github.io/r2d2-postgres/doc/r2d2_postgres

Example

extern crate r2d2;
extern crate r2d2_postgres;
extern crate postgres;

use std::sync::Arc;
use std::default::Default;
use postgres::SslMode;
use r2d2_postgres::PostgresPoolManager;

fn main() {
    let config = Default::default();
    let manager = PostgresPoolManager::new("postgres://postgres@localhost",
                                           SslMode::None);
    let error_handler = r2d2::LoggingErrorHandler;
    let pool = Arc::new(r2d2::Pool::new(config, manager, error_handler).unwrap());

    for i in range(0, 10i32) {
        let pool = pool.clone();
        spawn(proc() {
            let conn = pool.get().unwrap();
            conn.execute("INSERT INTO foo (bar) VALUES ($1)", &[&i]).unwrap();
        });
    }
}