diesel-connection 1.0.6

Static diesel r2d2 connection pooling.
Documentation

diesel-connection

License Cargo Documentation

Static diesel r2d2 connection pooling.

DATABASE_URL env sets postgres database url within connection manager MAX_DB_CONNECTIONS env sets max postgres connections within connection pool

The tracing feature flag substitutes connections instrumented with opentelemetry. See diesel-tracing for details.

#[actix_rt::main]
async fn main() -> Result<(), PoolError> {
  // DATABASE_URL can be set any time before the pool is lazily initialized on first use
  dotenv().expect("Unable to load .env file");
  env_logger::init();

  let conn = get_connection()?;
}