mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-07 17:24:24 +01:00
add capture_changes per-connection flag
This commit is contained in:
10
core/lib.rs
10
core/lib.rs
@@ -278,6 +278,7 @@ impl Database {
|
||||
cache_size: Cell::new(default_cache_size),
|
||||
readonly: Cell::new(false),
|
||||
wal_checkpoint_disabled: Cell::new(false),
|
||||
capture_changes: Cell::new(false),
|
||||
});
|
||||
if let Err(e) = conn.register_builtins() {
|
||||
return Err(LimboError::ExtensionError(e));
|
||||
@@ -330,6 +331,7 @@ impl Database {
|
||||
cache_size: Cell::new(default_cache_size),
|
||||
readonly: Cell::new(false),
|
||||
wal_checkpoint_disabled: Cell::new(false),
|
||||
capture_changes: Cell::new(false),
|
||||
});
|
||||
|
||||
if let Err(e) = conn.register_builtins() {
|
||||
@@ -450,6 +452,7 @@ pub struct Connection {
|
||||
cache_size: Cell<i32>,
|
||||
readonly: Cell<bool>,
|
||||
wal_checkpoint_disabled: Cell<bool>,
|
||||
capture_changes: Cell<bool>,
|
||||
}
|
||||
|
||||
impl Connection {
|
||||
@@ -724,6 +727,13 @@ impl Connection {
|
||||
self.cache_size.set(size);
|
||||
}
|
||||
|
||||
pub fn get_capture_changes(&self) -> bool {
|
||||
self.capture_changes.get()
|
||||
}
|
||||
pub fn set_capture_changes(&self, value: bool) {
|
||||
self.capture_changes.set(value);
|
||||
}
|
||||
|
||||
#[cfg(feature = "fs")]
|
||||
pub fn open_new(&self, path: &str, vfs: &str) -> Result<(Arc<dyn IO>, Arc<Database>)> {
|
||||
Database::open_with_vfs(&self._db, path, vfs)
|
||||
|
||||
Reference in New Issue
Block a user