r2d2-diesel
Provides r2d2 support to allow connection pooling with Diesel.
Examples
The examples creates a connection pool with default settings for a PostgreSQL or SQLite database running on localhost, then creates a bunch of threads and acquires a connection from the pool for each thread.
Executable versions are in examples/ which you can run with
cargo run --example postgres
or
cargo run --example sqlite --features sqlite
.
extern crate diesel;
extern crate r2d2;
extern crate r2d2_diesel;
use thread;
use PgConnection;
use ConnectionManager;