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)); }