aboutsummaryrefslogtreecommitdiff
path: root/database/src/kv/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'database/src/kv/mod.rs')
-rw-r--r--database/src/kv/mod.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/database/src/kv/mod.rs b/database/src/kv/mod.rs
index f90f07e..257eec4 100644
--- a/database/src/kv/mod.rs
+++ b/database/src/kv/mod.rs
@@ -27,7 +27,7 @@ use crate::{
use anyhow::{Result, anyhow};
use jellyobject::ObjectBuffer;
use log::{debug, info};
-use std::borrow::Cow;
+use std::{borrow::Cow, fmt::Write};
pub type SubtreeNum = u32;
@@ -132,6 +132,17 @@ impl Transaction for &mut dyn jellykv::Transaction {
}
Ok(total)
}
+
+ fn debug_info(&self) -> Result<String> {
+ let mut o = String::new();
+ let rc = read_counter(*self, &T_ROW_COUNTER.to_be_bytes(), 0)?;
+ writeln!(o, "Row Counter: {rc}")?;
+ writeln!(o, "Indices:")?;
+ for (is, ik) in list_indices(*self)? {
+ writeln!(o, "\tIS={is} IK={ik}")?;
+ }
+ Ok(o)
+ }
}
fn get_or_create_index(txn: &mut dyn jellykv::Transaction, ik: &IndexKey) -> Result<SubtreeNum> {