Function limiting_factor::database::initialize_database_pool[][src]

pub fn initialize_database_pool(
    url: &str,
    max_size: u32
) -> Result<PostgreSQLPool, PoolError>
Expand description

Builds a r2d2 database pool, to be used in a request guard or a managed state.

Examples

rocket::ignite()
   .manage(initialize_database_pool(String::from("postgres://::1/test"), 4)?)
   .mount("/", routes)
   .launch();