From 191f73208837fac79ea2c81a44672369bfc3c159 Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Wed, 2 Jul 2025 13:35:06 -0300 Subject: [PATCH] `from_uri` was not passing mvcc and indexes flag to database creation for memory path --- cli/app.rs | 2 +- core/lib.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/app.rs b/cli/app.rs index 4746edd69..376be0bd3 100644 --- a/cli/app.rs +++ b/cli/app.rs @@ -28,7 +28,7 @@ use tracing_appender::non_blocking::WorkerGuard; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; use turso_core::{Connection, Database, LimboError, OpenFlags, Statement, StepResult, Value}; -#[derive(Parser)] +#[derive(Parser, Debug)] #[command(name = "Turso")] #[command(author, version, about, long_about = None)] pub struct Opts { diff --git a/core/lib.rs b/core/lib.rs index 82e6ba506..6a1ed502c 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -200,6 +200,7 @@ impl Database { let shared_page_cache = Arc::new(RwLock::new(DumbLruPageCache::default())); let schema = Arc::new(RwLock::new(Schema::new(enable_indexes))); + dbg!(enable_indexes); let db = Database { mv_store, path: path.to_string(), @@ -372,7 +373,7 @@ impl Database { } }, }; - let db = Self::open_file_with_flags(io.clone(), path, flags, indexes, mvcc)?; + let db = Self::open_file_with_flags(io.clone(), path, flags, mvcc, indexes)?; Ok((io, db)) } None => { @@ -380,7 +381,7 @@ impl Database { MEMORY_PATH => Arc::new(MemoryIO::new()), _ => Arc::new(PlatformIO::new()?), }; - let db = Self::open_file_with_flags(io.clone(), path, flags, indexes, mvcc)?; + let db = Self::open_file_with_flags(io.clone(), path, flags, mvcc, indexes)?; Ok((io, db)) } } @@ -600,7 +601,8 @@ impl Connection { let flags = opts.get_flags()?; if opts.path == MEMORY_PATH || matches!(opts.mode, OpenMode::Memory) { let io = Arc::new(MemoryIO::new()); - let db = Database::open_file_with_flags(io.clone(), MEMORY_PATH, flags, false, false)?; + let db = + Database::open_file_with_flags(io.clone(), MEMORY_PATH, flags, mvcc, use_indexes)?; let conn = db.connect()?; return Ok((io, conn)); }