diff --git a/bindings/javascript/Cargo.toml b/bindings/javascript/Cargo.toml index 18a9b319d..077f07fb3 100644 --- a/bindings/javascript/Cargo.toml +++ b/bindings/javascript/Cargo.toml @@ -16,5 +16,8 @@ napi = { version = "3.1.3", default-features = false, features = ["napi6"] } napi-derive = { version = "3.1.1", default-features = true } tracing-subscriber = { version = "0.3.19", features = ["env-filter"] } +[features] +encryption = ["turso_core/encryption"] + [build-dependencies] napi-build = "2.2.3" diff --git a/bindings/javascript/src/lib.rs b/bindings/javascript/src/lib.rs index b02503a87..3ada9ff0e 100644 --- a/bindings/javascript/src/lib.rs +++ b/bindings/javascript/src/lib.rs @@ -561,6 +561,7 @@ impl turso_core::DatabaseStorage for DatabaseFile { fn read_page( &self, page_idx: usize, + #[cfg(feature = "encryption")] _key: Option<&turso_core::EncryptionKey>, c: turso_core::Completion, ) -> turso_core::Result { let r = c.as_read(); @@ -577,6 +578,7 @@ impl turso_core::DatabaseStorage for DatabaseFile { &self, page_idx: usize, buffer: Arc, + #[cfg(feature = "encryption")] _key: Option<&turso_core::EncryptionKey>, c: turso_core::Completion, ) -> turso_core::Result { let size = buffer.len(); @@ -589,6 +591,7 @@ impl turso_core::DatabaseStorage for DatabaseFile { page_idx: usize, page_size: usize, buffers: Vec>, + #[cfg(feature = "encryption")] _key: Option<&turso_core::EncryptionKey>, c: turso_core::Completion, ) -> turso_core::Result { let pos = page_idx.saturating_sub(1) * page_size;