aboutsummaryrefslogtreecommitdiffstats
path: root/license-generator/src/database.rs
blob: 28673c4edb49e321f7dc1a709e14df39c519684e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::env;

use mysql;

use errors::*;

fn get_database_connection() -> Result<mysql::PooledConn> {
    let connection_url = env::var("DATABASE_URL")?;
    let pool = mysql::Pool::new_manual(10, 50, connection_url)?;
    let cx = pool.get_conn()?;

    Ok(cx)
}