add capture_changes per-connection flag

This commit is contained in:
Nikita Sivukhin
2025-07-02 11:35:35 +04:00
parent 7ba8ab6efc
commit 3f0716b2a4

View File

@@ -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)