mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-31 13:54:27 +01:00
update Rust bindings to pass encryption options
This commit is contained in:
@@ -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<String>,
|
||||
encryption_opts: Option<EncryptionOpts>,
|
||||
}
|
||||
|
||||
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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user