1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-10 04:53:54 +00:00

re-added sqlite check_db code, cleanup

This commit is contained in:
Nils Domrose 2019-05-27 22:58:52 +02:00
parent 6c38026ef5
commit dc36f0cb6c
4 changed files with 28 additions and 11 deletions

View file

@ -2,10 +2,6 @@ use std::ops::Deref;
use diesel::r2d2;
use diesel::r2d2::ConnectionManager;
#[cfg(feature = "sqlite")]
use diesel::sqlite::SqliteConnection;
#[cfg(feature = "mysql")]
use diesel::mysql::MysqlConnection;
use diesel::{Connection as DieselConnection, ConnectionError};
use rocket::http::Status;
@ -16,11 +12,11 @@ use crate::CONFIG;
/// An alias to the database connection used
#[cfg(feature = "sqlite")]
type Connection = SqliteConnection;
type Connection = diesel::sqlite::SqliteConnection;
#[cfg(feature = "mysql")]
type Connection = MysqlConnection;
type Connection = diesel::mysql::MysqlConnection;
/// An alias to the type for a pool of Diesel MySQL connections.
/// An alias to the type for a pool of Diesel connections.
type Pool = r2d2::Pool<ConnectionManager<Connection>>;
/// Connection request guard type: a wrapper around an r2d2 pooled connection.