diff --git a/refinery/Cargo.toml b/refinery/Cargo.toml index f55f0c60..890bd414 100644 --- a/refinery/Cargo.toml +++ b/refinery/Cargo.toml @@ -13,21 +13,24 @@ edition = "2018" [features] default = ["toml"] -rusqlite-bundled = ["refinery-core/rusqlite-bundled"] -rusqlite = ["refinery-core/rusqlite"] -postgres = ["refinery-core/postgres"] -mysql = ["refinery-core/mysql"] -tokio-postgres = ["refinery-core/tokio-postgres"] -mysql_async = ["refinery-core/mysql_async"] -tiberius = ["refinery-core/tiberius"] -tiberius-config = ["refinery-core/tiberius", "refinery-core/tiberius-config"] +config = ["refinery-core/config"] +rusqlite-bundled = ["refinery-core/rusqlite-bundled", "config"] +rusqlite = ["refinery-core/rusqlite", "config"] +postgres = ["refinery-core/postgres", "config"] +postgres-no-tls = ["refinery-core/postgres-no-tls"] +mysql = ["refinery-core/mysql", "config"] +tokio-postgres = ["refinery-core/tokio-postgres", "config"] +tokio-postgres-no-tls = ["refinery-core/tokio-postgres-no-tls"] +mysql_async = ["refinery-core/mysql_async", "config"] +tiberius = ["refinery-core/tiberius", "config"] +tiberius-config = ["refinery-core/tiberius", "refinery-core/tiberius-config", "config"] serde = ["refinery-core/serde"] toml = ["refinery-core/toml"] enums = ["refinery-macros/enums"] int8-versions = ["refinery-core/int8-versions", "refinery-macros/int8-versions"] [dependencies] -refinery-core = { version = "0.9.0", path = "../refinery_core" } +refinery-core = { version = "0.9.0", path = "../refinery_core", default-features = false } refinery-macros = { version = "0.9.0", path = "../refinery_macros" } [dev-dependencies] diff --git a/refinery/src/lib.rs b/refinery/src/lib.rs index 945303cc..569e612a 100644 --- a/refinery/src/lib.rs +++ b/refinery/src/lib.rs @@ -31,6 +31,7 @@ embedded::migrations::runner().run(&mut conn).unwrap(); for more examples refer to the [examples](https://github.com/rust-db/refinery/tree/master/examples) */ +#[cfg(feature = "config")] pub use refinery_core::config; pub use refinery_core::{ error, load_sql_migrations, Error, Migration, Report, Runner, SchemaVersion, Target, diff --git a/refinery_cli/Cargo.toml b/refinery_cli/Cargo.toml index e51ac49f..354d85f0 100644 --- a/refinery_cli/Cargo.toml +++ b/refinery_cli/Cargo.toml @@ -24,7 +24,7 @@ mssql = ["refinery-core/tiberius-config", "tokio"] int8-versions = ["refinery-core/int8-versions"] [dependencies] -refinery-core = { version = "0.9.0", path = "../refinery_core", default-features = false, features = ["toml"] } +refinery-core = { version = "0.9.0", path = "../refinery_core", default-features = false, features = ["toml", "config"] } clap = { version = "4", features = ["derive"] } human-panic = "2" toml = "0.8" diff --git a/refinery_core/Cargo.toml b/refinery_core/Cargo.toml index 3fbd0fe4..7772deee 100644 --- a/refinery_core/Cargo.toml +++ b/refinery_core/Cargo.toml @@ -10,13 +10,19 @@ edition = "2021" [features] default = [] -mysql_async = ["dep:mysql_async"] -postgres = ["dep:postgres", "dep:postgres-native-tls", "dep:native-tls"] -rusqlite-bundled = ["rusqlite", "rusqlite/bundled"] +config = [] +mysql_async = ["dep:mysql_async", "config"] +postgres = ["postgres-no-tls", "postgres-tls", "config"] +postgres-no-tls = ["dep:postgres"] +postgres-tls = ["dep:postgres-native-tls", "tls"] +rusqlite = ["dep:rusqlite", "config"] +rusqlite-bundled = ["rusqlite", "rusqlite/bundled", "config"] serde = ["dep:serde", "time/serde"] -tiberius = ["dep:tiberius", "futures", "tokio", "tokio/net"] -tiberius-config = ["tiberius", "tokio", "tokio-util", "serde"] -tokio-postgres = ["dep:postgres-native-tls", "dep:native-tls", "dep:tokio-postgres", "tokio", "tokio/rt"] +tiberius = ["dep:tiberius", "dep:futures", "dep:tokio", "tokio/net"] +tiberius-config = ["tiberius", "dep:tokio-util", "dep:serde", "config"] +tls = ["dep:native-tls"] +tokio-postgres = ["tokio-postgres-no-tls", "postgres-tls", "config"] +tokio-postgres-no-tls = ["dep:tokio-postgres", "dep:tokio", "tokio/rt"] toml = ["serde", "dep:toml"] int8-versions = [] diff --git a/refinery_core/src/drivers/mod.rs b/refinery_core/src/drivers/mod.rs index 867d4c4d..c1240cee 100644 --- a/refinery_core/src/drivers/mod.rs +++ b/refinery_core/src/drivers/mod.rs @@ -1,13 +1,13 @@ #[cfg(feature = "rusqlite")] pub mod rusqlite; -#[cfg(feature = "tokio-postgres")] +#[cfg(feature = "tokio-postgres-no-tls")] pub mod tokio_postgres; #[cfg(feature = "mysql_async")] pub mod mysql_async; -#[cfg(feature = "postgres")] +#[cfg(feature = "postgres-no-tls")] pub mod postgres; #[cfg(feature = "mysql")] @@ -16,4 +16,5 @@ pub mod mysql; #[cfg(feature = "tiberius")] pub mod tiberius; +#[cfg(feature = "config")] mod config; diff --git a/refinery_core/src/lib.rs b/refinery_core/src/lib.rs index 2d20865a..0dce2076 100644 --- a/refinery_core/src/lib.rs +++ b/refinery_core/src/lib.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "config")] pub mod config; mod drivers; pub mod error; @@ -16,13 +17,13 @@ pub use crate::util::{ #[cfg(feature = "rusqlite")] pub use rusqlite; -#[cfg(feature = "postgres")] +#[cfg(feature = "postgres-no-tls")] pub use postgres; #[cfg(feature = "mysql")] pub use mysql; -#[cfg(feature = "tokio-postgres")] +#[cfg(feature = "tokio-postgres-no-tls")] pub use tokio_postgres; #[cfg(feature = "mysql_async")]