From 6687923163acac2ccd1e80b9b9b867d9b78ceaec Mon Sep 17 00:00:00 2001 From: jaredzhou Date: Thu, 27 Jan 2022 10:25:22 +0800 Subject: [PATCH] make r2d2 as a feature --- Cargo.toml | 3 ++- src/lib.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 678e1a26..a1e7e0b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ modern-full = [ "chrono", "serde_json", "url", + "r2d2", ] [dependencies] @@ -48,7 +49,7 @@ cast = { version = "0.3", features = ["std"] } arrow = { version = "6.5.0", default-features = false, features = ["prettyprint"] } rust_decimal = "1.14" strum = { version = "0.23", features = ["derive"] } -r2d2 = "0.8.9" +r2d2 = { version = "0.8.9", optional = true } [dev-dependencies] doc-comment = "0.3" diff --git a/src/lib.rs b/src/lib.rs index 1deaf5ab..c389a715 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,6 +78,7 @@ pub use crate::config::{AccessMode, Config, DefaultNullOrder, DefaultOrder}; pub use crate::error::Error; pub use crate::ffi::ErrorCode; pub use crate::params::{params_from_iter, Params, ParamsFromIter}; +#[cfg(feature = "r2d2")] pub use crate::r2d2::DuckdbConnectionManager; pub use crate::row::{AndThenRows, Map, MappedRows, Row, RowIndex, Rows}; pub use crate::statement::Statement; @@ -94,6 +95,7 @@ mod config; mod inner_connection; mod params; mod pragma; +#[cfg(feature = "r2d2")] mod r2d2; mod raw_statement; mod row;