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.

```rust

[actix_rt::main]

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

let conn = get_connection()?; } ```