1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-08-06 17:40:59 +00:00

test: add test for exporting and importing data from tree store

This commit is contained in:
Tglman 2023-08-27 18:56:09 +01:00
parent 5e52438b6f
commit 0f1c3222ed
6 changed files with 132 additions and 21 deletions

View file

@ -27,7 +27,7 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
Ok(Arc::new(Engine { persy }))
}
fn open_tree(&self, name: &'static str) -> Result<Arc<dyn KvTree>> {
fn open_tree(&self, name: &str) -> Result<Arc<dyn KvTree>> {
// Create if it doesn't exist
if !self.persy.exists_index(name)? {
let mut tx = self.persy.begin()?;
@ -46,7 +46,7 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
Ok(())
}
fn export(&self, exporter: &mut Box<dyn KvExport>) -> Result<()> {
fn export(&self, exporter: &mut dyn KvExport) -> Result<()> {
let snapshot = self.persy.snapshot()?;
let indexes = snapshot.list_indexes()?;
for (index, _) in indexes {