Fix compatibility with SQlite

Also fixes a bug in plume-models
This commit is contained in:
Bat
2018-10-06 12:35:58 +01:00
parent 5fa7a2a742
commit 4d382d8014
5 changed files with 16 additions and 12 deletions
+3 -3
View File
@@ -38,7 +38,7 @@ use diesel::r2d2::ConnectionManager;
use rocket::State;
use rocket_contrib::Template;
use rocket_csrf::CsrfFairingBuilder;
use plume_models::{DB_URL, Connection, db_conn::PgPool};
use plume_models::{DB_URL, Connection, db_conn::DbPool};
use workerpool::{Pool, thunk::ThunkWorker};
mod api;
@@ -48,11 +48,11 @@ mod routes;
type Worker<'a> = State<'a, Pool<ThunkWorker<()>>>;
/// Initializes a database pool.
fn init_pool() -> Option<PgPool> {
fn init_pool() -> Option<DbPool> {
dotenv::dotenv().ok();
let manager = ConnectionManager::<Connection>::new(DB_URL.as_str());
PgPool::new(manager).ok()
DbPool::new(manager).ok()
}
fn main() {