|
|
@ -2,7 +2,7 @@ use std::ops::Deref;
|
|
|
|
|
|
|
|
|
|
|
|
use diesel::r2d2;
|
|
|
|
use diesel::r2d2;
|
|
|
|
use diesel::r2d2::ConnectionManager;
|
|
|
|
use diesel::r2d2::ConnectionManager;
|
|
|
|
use diesel::sqlite::SqliteConnection;
|
|
|
|
use diesel::sqlite::MysqlConnection;
|
|
|
|
use diesel::{Connection as DieselConnection, ConnectionError};
|
|
|
|
use diesel::{Connection as DieselConnection, ConnectionError};
|
|
|
|
|
|
|
|
|
|
|
|
use rocket::http::Status;
|
|
|
|
use rocket::http::Status;
|
|
|
@ -12,9 +12,9 @@ use rocket::{Outcome, Request, State};
|
|
|
|
use crate::CONFIG;
|
|
|
|
use crate::CONFIG;
|
|
|
|
|
|
|
|
|
|
|
|
/// An alias to the database connection used
|
|
|
|
/// An alias to the database connection used
|
|
|
|
type Connection = SqliteConnection;
|
|
|
|
type Connection = MysqlConnection;
|
|
|
|
|
|
|
|
|
|
|
|
/// An alias to the type for a pool of Diesel SQLite connections.
|
|
|
|
/// An alias to the type for a pool of Diesel MySQL connections.
|
|
|
|
type Pool = r2d2::Pool<ConnectionManager<Connection>>;
|
|
|
|
type Pool = r2d2::Pool<ConnectionManager<Connection>>;
|
|
|
|
|
|
|
|
|
|
|
|
/// Connection request guard type: a wrapper around an r2d2 pooled connection.
|
|
|
|
/// Connection request guard type: a wrapper around an r2d2 pooled connection.
|
|
|
|