aboutsummaryrefslogtreecommitdiff
path: root/import/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'import/src/db.rs')
-rw-r--r--import/src/db.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/import/src/db.rs b/import/src/db.rs
index c667cf5..39b5b3e 100644
--- a/import/src/db.rs
+++ b/import/src/db.rs
@@ -1,7 +1,8 @@
use anyhow::{anyhow, Context};
use jellybase::database::{
+ redb::ReadableTable,
tantivy::{doc, DateTime},
- DataAcid, ReadableTable, Ser, T_NODE, T_NODE_EXTENDED, T_NODE_IMPORT,
+ DataAcid, Ser, T_NODE, T_NODE_EXTENDED, T_NODE_IMPORT,
};
use jellycommon::{ExtendedNode, Node};
use log::info;
@@ -37,7 +38,7 @@ impl ImportStorage for DatabaseStorage<'_> {
info!("removing old nodes...");
let txn = self.db.inner.begin_write()?;
let mut table = txn.open_table(T_NODE)?;
- table.drain::<&str>(..)?;
+ table.retain(|_, _| false)?;
drop(table);
txn.commit()?;
Ok(())
@@ -84,7 +85,7 @@ impl ImportStorage for DatabaseStorage<'_> {
info!("clearing temporary node tree...");
let txn = self.db.inner.begin_write()?;
let mut table = txn.open_table(T_NODE_IMPORT)?;
- table.drain::<&str>(..)?;
+ table.retain(|_, _| false)?;
drop(table);
txn.commit()?;
@@ -110,7 +111,7 @@ impl ImportStorage for MemoryStorage<'_> {
info!("removing old nodes...");
let txn = self.db.inner.begin_write()?;
let mut table = txn.open_table(T_NODE)?;
- table.drain::<&str>(..)?;
+ table.retain(|_, _| false)?;
drop(table);
txn.commit()?;
self.db