aboutsummaryrefslogtreecommitdiff
path: root/src/db/sqlite_adapter.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-03-08 16:02:58 +0100
committerAlex Auvolat <alex@adnab.me>2024-03-08 16:02:58 +0100
commit66c23890c1a6e73fd6c5246642e087cd2866451e (patch)
treed26a7d98f8e23497419b675f6689c348fafe2de4 /src/db/sqlite_adapter.rs
parent05c92204ecab87540806073ac4deedfd58519240 (diff)
downloadgarage-66c23890c1a6e73fd6c5246642e087cd2866451e.tar.gz
garage-66c23890c1a6e73fd6c5246642e087cd2866451e.zip
[rm-sled] Implement some missing functionality in garage_db
Diffstat (limited to 'src/db/sqlite_adapter.rs')
-rw-r--r--src/db/sqlite_adapter.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/db/sqlite_adapter.rs b/src/db/sqlite_adapter.rs
index 1a7ae5f0..d1394355 100644
--- a/src/db/sqlite_adapter.rs
+++ b/src/db/sqlite_adapter.rs
@@ -363,6 +363,11 @@ impl<'a> ITx for SqliteTx<'a> {
Ok(old_val)
}
+ fn clear(&mut self, tree: usize) -> TxOpResult<()> {
+ let tree = self.get_tree(tree)?;
+ self.tx.execute(&format!("DELETE FROM {}", tree), [])?;
+ Ok(())
+ }
fn iter(&self, _tree: usize) -> TxOpResult<TxValueIter<'_>> {
unimplemented!();