From 1d4f089e77e7fab4311954b8b2d81815325bdf0c Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sun, 23 May 2021 13:35:11 +0300 Subject: [PATCH] chore: don't support rusqlite feature name --- migra-cli/src/config.rs | 8 ++++---- migra-cli/src/database/clients/mod.rs | 2 +- migra-cli/src/database/connection.rs | 2 +- migra-cli/tests/commands.rs | 18 +++++++++--------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/migra-cli/src/config.rs b/migra-cli/src/config.rs index f8ca862..7a18243 100644 --- a/migra-cli/src/config.rs +++ b/migra-cli/src/config.rs @@ -28,7 +28,7 @@ fn recursive_find_project_root() -> MigraResult { #[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") diff --git a/migra-cli/src/database/clients/mod.rs b/migra-cli/src/database/clients/mod.rs index 3705af6..f2fed90 100644 --- a/migra-cli/src/database/clients/mod.rs +++ b/migra-cli/src/database/clients/mod.rs @@ -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::*; } diff --git a/migra-cli/src/database/connection.rs b/migra-cli/src/database/connection.rs index 021a257..d1acdb8 100644 --- a/migra-cli/src/database/connection.rs +++ b/migra-cli/src/database/connection.rs @@ -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)?) } diff --git a/migra-cli/tests/commands.rs b/migra-cli/tests/commands.rs index f21ca2c..d43dcef 100644 --- a/migra-cli/tests/commands.rs +++ b/migra-cli/tests/commands.rs @@ -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",