diesel-connection 4.0.0

Static diesel r2d2 connection pooling.
Documentation

diesel-connection

License Cargo Documentation

Static diesel r2d2 connection pooling.

Connection urls are provided by environment variables using env-url using the env variable DATABASE_URL.

MAX_DB_CONNECTIONS env sets max connections within connection pool

The dotenv feature flag enables automatic at-most-once dotenv loading via dotenvy. This is necessary because pool statics are initialized pre-main via static_init.

use diesel_connection::{pg::get_connection, PoolError};

#[actix_rt::main]
async fn main() -> Result<(), PoolError> {
  let conn = get_connection()?;
}