mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-10 18:55:57 +03:00
re-added sqlite check_db code, cleanup
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user