Archived
1
0
Fork 0

chore: don't support rusqlite feature name

This commit is contained in:
Dmitriy Pleshevskiy 2021-05-23 13:35:11 +03:00
parent 0633780b84
commit 1d4f089e77
4 changed files with 15 additions and 15 deletions

View file

@ -28,7 +28,7 @@ fn recursive_find_project_root() -> MigraResult<PathBuf> {
#[cfg(any(
not(feature = "postgres"),
not(feature = "mysql"),
not(any(feature = "sqlite", feature = "rusqlite"))
not(feature = "sqlite")
))]
macro_rules! please_install_with {
(feature $database_name:expr) => {
@ -57,7 +57,7 @@ pub(crate) enum SupportedDatabaseClient {
Postgres,
#[cfg(feature = "mysql")]
Mysql,
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
Sqlite,
}
@ -68,7 +68,7 @@ impl Default for SupportedDatabaseClient {
SupportedDatabaseClient::Postgres
} else if #[cfg(feature = "mysql")] {
SupportedDatabaseClient::Mysql
} else if #[cfg(any(feature = "sqlite", feature = "rusqlite"))] {
} else if #[cfg(feature = "sqlite")] {
SupportedDatabaseClient::Sqlite
}
}
@ -116,7 +116,7 @@ impl DatabaseConfig {
}
} else if connection_string.ends_with(".db") {
cfg_if! {
if #[cfg(any(feature = "sqlite", feature = "rusqlite"))] {
if #[cfg(feature = "sqlite")] {
Some(SupportedDatabaseClient::Sqlite)
} else {
please_install_with!(feature "sqlite")

View file

@ -13,7 +13,7 @@ cfg_if! {
}
cfg_if! {
if #[cfg(any(feature = "sqlite", feature = "rusqlite"))] {
if #[cfg(feature = "sqlite")] {
mod sqlite;
pub use self::sqlite::*;
}

View file

@ -44,7 +44,7 @@ impl DatabaseConnectionManager {
}
#[cfg(feature = "mysql")]
SupportedDatabaseClient::Mysql => Box::new(MySqlConnection::open(&connection_string)?),
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
SupportedDatabaseClient::Sqlite => {
Box::new(SqliteConnection::open(&connection_string)?)
}

View file

@ -161,7 +161,7 @@ Pending migrations:
#[cfg(feature = "mysql")]
inner(MYSQL_URL)?;
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
remove_sqlite_db().and_then(|_| inner(SQLITE_URL))?;
Ok(())
@ -239,7 +239,7 @@ Pending migrations:
#[cfg(feature = "mysql")]
inner("mysql")?;
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
remove_sqlite_db().and_then(|_| inner("sqlite"))?;
Ok(())
@ -290,7 +290,7 @@ Pending migrations:
#[cfg(feature = "mysql")]
inner("mysql")?;
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
remove_sqlite_db().and_then(|_| inner("sqlite"))?;
Ok(())
@ -341,7 +341,7 @@ Pending migrations:
#[cfg(feature = "mysql")]
inner("mysql")?;
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
remove_sqlite_db().and_then(|_| inner("sqlite"))?;
Ok(())
@ -404,7 +404,7 @@ mod make {
#[cfg(feature = "mysql")]
inner("mysql")?;
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
remove_sqlite_db().and_then(|_| inner("sqlite"))?;
Ok(())
@ -471,7 +471,7 @@ mod upgrade {
Ok(())
})?;
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
remove_sqlite_db().and_then(|_| {
inner("sqlite", || {
use rusqlite::Connection;
@ -527,7 +527,7 @@ mod upgrade {
Ok(())
})?;
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
remove_sqlite_db().and_then(|_| {
inner("sqlite_invalid", || {
use rusqlite::Connection;
@ -579,7 +579,7 @@ mod upgrade {
Ok(())
})?;
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
remove_sqlite_db().and_then(|_| {
inner("sqlite_invalid", || {
use rusqlite::Connection;
@ -712,7 +712,7 @@ mod apply {
}
}
#[cfg(any(feature = "sqlite", feature = "rusqlite"))]
#[cfg(feature = "sqlite")]
remove_sqlite_db().and_then(|_| {
inner(
"sqlite",