From 4ee6bdac1b4c695a25b2180efed6bf5e390a3b15 Mon Sep 17 00:00:00 2001 From: Avinash Sajjanshetty Date: Thu, 2 Oct 2025 18:51:44 +0530 Subject: [PATCH] update Rust bindings to pass encryption options --- bindings/rust/src/lib.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bindings/rust/src/lib.rs b/bindings/rust/src/lib.rs index 093a71e7f..bca141619 100644 --- a/bindings/rust/src/lib.rs +++ b/bindings/rust/src/lib.rs @@ -48,7 +48,7 @@ pub use params::IntoParams; use std::fmt::Debug; use std::num::NonZero; use std::sync::{Arc, Mutex}; -use turso_core::OpenFlags; +use turso_core::{EncryptionOpts, OpenFlags}; // Re-exports rows pub use crate::rows::{Row, Rows}; @@ -84,6 +84,7 @@ pub struct Builder { enable_mvcc: bool, enable_encryption: bool, vfs: Option, + encryption_opts: Option, } impl Builder { @@ -94,6 +95,7 @@ impl Builder { enable_mvcc: false, enable_encryption: false, vfs: None, + encryption_opts: None, } } @@ -107,6 +109,11 @@ impl Builder { self } + pub fn with_encryption(mut self, opts: EncryptionOpts) -> Self { + self.encryption_opts = Some(opts); + self + } + pub fn with_io(mut self, vfs: String) -> Self { self.vfs = Some(vfs); self @@ -124,7 +131,7 @@ impl Builder { self.path.as_str(), OpenFlags::default(), opts, - None, + self.encryption_opts.clone(), )?; Ok(Database { inner: db }) }