[][src]Function dhb_postgres_heroku::get_pool

pub fn get_pool(database_url: &str, max_size: u32) -> HerokuPool

Get a heroku-capable r2d2 connection pool from a postgres url and a maximum size.

Example:

let database_url = "postgres://username:password@host:port/db_name";
let max_size = 4;
let mut pool = dhb_postgres_heroku::get_pool(&database_url, max_size);

Panics

This will panic if it can't connect.
That could be because your database_url is wrong, because your database is down, because your internet connection is failing, etc.