Archived
1
0
Fork 0
This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
enve/examples/diesel/src/db.rs
2020-07-02 23:24:17 +05:30

8 lines
270 B
Rust

use super::config;
use diesel::pg::PgConnection;
use diesel::prelude::*;
pub fn establish_connection() -> PgConnection {
let database_url = config::DATABASE_URL();
PgConnection::establish(database_url).expect(&format!("Error connecting to {}", database_url))
}