diesel-connection 1.0.0

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

#[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()?;
}