aboutsummaryrefslogtreecommitdiff
path: root/base/src
diff options
context:
space:
mode:
Diffstat (limited to 'base/src')
-rw-r--r--base/src/database.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/src/database.rs b/base/src/database.rs
index a213a40..e9fe156 100644
--- a/base/src/database.rs
+++ b/base/src/database.rs
@@ -75,6 +75,14 @@ impl Database {
Ok(None)
}
}
+ pub fn clear_nodes(&self) -> Result<()> {
+ let txn = self.inner.begin_write()?;
+ let mut table = txn.open_table(T_NODE)?;
+ table.retain(|_, _| false)?;
+ drop(table);
+ txn.commit()?;
+ Ok(())
+ }
pub fn get_node_udata(&self, id: NodeID, username: &str) -> Result<Option<NodeUserData>> {
let txn = self.inner.begin_read()?;
let t_node = txn.open_table(T_USER_NODE)?;