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.

```rust use dieselconnection::{pg::getconnection, PoolError};

[actix_rt::main]

async fn main() -> Result<(), PoolError> { let conn = get_connection()?; } ```