From 36d4b09830bfdff81fd3c0ec1c5ceef08d11d05b Mon Sep 17 00:00:00 2001 From: Avinash Sajjanshetty Date: Thu, 2 Oct 2025 19:04:15 +0530 Subject: [PATCH] Use the updated bindings for encryption throughput tests --- perf/encryption/src/main.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/perf/encryption/src/main.rs b/perf/encryption/src/main.rs index 6cc5b7829..c2b5fc595 100644 --- a/perf/encryption/src/main.rs +++ b/perf/encryption/src/main.rs @@ -4,13 +4,7 @@ use rand::{Rng, RngCore, SeedableRng}; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Barrier}; use std::time::{Duration, Instant}; -use turso::{Builder, Database, Result}; - -#[derive(Debug, Clone)] -struct EncryptionOpts { - cipher: String, - hexkey: String, -} +use turso::{Builder, Database, EncryptionOpts, Result}; #[derive(Parser)] #[command(name = "encryption-throughput")] @@ -315,6 +309,14 @@ async fn setup_database( encryption_opts: &Option, ) -> Result { let builder = Builder::new_local(db_path); + let builder = if let Some(opts) = encryption_opts { + builder + .experimental_encryption(true) + .with_encryption(opts.clone()) + } else { + builder + }; + let db = builder.build().await?; let conn = db.connect()?;