diesel-connection 1.0.5

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

This library uses booter::boot() to initialize.

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

#[actix_rt::main]
async fn main() -> Result<(), PoolError> {
  // Env can be configured before booter::boot giving fine-grain initialization control
  dotenv().expect("Unable to load .env file");
  env_logger::init();
  // This calls registered initialization functions; with this we initialize our static connection pool
  booter::boot();
  let conn = get_connection()?;
}