mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
cli: Add --experimental-mvcc
option to enable MVCC
This commit is contained in:
parent
5d0982f5db
commit
96175cccf7
14 changed files with 27 additions and 18 deletions
|
@ -51,6 +51,8 @@ pub struct Opts {
|
|||
\t'io-uring' when built for Linux with feature 'io_uring'\n"
|
||||
)]
|
||||
pub io: Io,
|
||||
#[clap(long, help = "Enable experimental MVCC feature")]
|
||||
pub experimental_mvcc: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -210,7 +212,7 @@ impl<'a> Limbo<'a> {
|
|||
_path => get_io(DbLocation::Path, opts.io)?,
|
||||
}
|
||||
};
|
||||
let db = Database::open_file(io.clone(), &db_file)?;
|
||||
let db = Database::open_file(io.clone(), &db_file, opts.experimental_mvcc)?;
|
||||
let conn = db.connect().unwrap();
|
||||
let h = LimboHelper::new(conn.clone(), io.clone());
|
||||
rl.set_helper(Some(h));
|
||||
|
@ -412,7 +414,7 @@ impl<'a> Limbo<'a> {
|
|||
}
|
||||
};
|
||||
self.io = Arc::clone(&io);
|
||||
let db = Database::open_file(self.io.clone(), path)?;
|
||||
let db = Database::open_file(self.io.clone(), path, self.opts.experimental_mvcc)?;
|
||||
self.conn = db.connect().unwrap();
|
||||
self.opts.db_file = path.to_string();
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue