diff --git a/Cargo.toml b/Cargo.toml index 66fb131d..e78d5063 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,7 @@ keywords = ["database"] [features] default = ["linkage"] bundled = ["sqlite3-sys/bundled"] +extension = [] linkage = ["sqlite3-sys/linkage"] [dependencies] diff --git a/src/connection.rs b/src/connection.rs index 146f8065..1462bc8a 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -183,6 +183,7 @@ impl Connection { } /// Enable loading extensions. + #[cfg(feature = "extension")] #[inline] pub fn enable_extension(&self) -> Result<()> { unsafe { @@ -195,6 +196,7 @@ impl Connection { } /// Disable loading extensions. + #[cfg(feature = "extension")] #[inline] pub fn disable_extension(&self) -> Result<()> { unsafe { @@ -207,6 +209,7 @@ impl Connection { } /// Load an extension. + #[cfg(feature = "extension")] #[inline] pub fn load_extension>(&self, name: T) -> Result<()> { unsafe { diff --git a/tests/connection.rs b/tests/connection.rs index 15ff4abe..53a6a8f6 100644 --- a/tests/connection.rs +++ b/tests/connection.rs @@ -114,18 +114,21 @@ fn set_busy_handler() { } } +#[cfg(feature = "extension")] #[test] fn enable_extension() { let connection = ok!(Connection::open(":memory:")); ok!(connection.enable_extension()); } +#[cfg(feature = "extension")] #[test] fn disable_extension() { let connection = ok!(Connection::open(":memory:")); ok!(connection.disable_extension()); } +#[cfg(feature = "extension")] #[test] fn load_extension() { let connection = ok!(Connection::open(":memory:"));