feat(smartdb): add operation log APIs, point-in-time revert support, and a web-based debug dashboard

This commit is contained in:
2026-04-02 17:02:03 +00:00
parent 943302f789
commit d34b8673e1
27 changed files with 3536 additions and 64 deletions
@@ -2,6 +2,7 @@ use std::collections::HashSet;
use bson::{doc, Bson, Document};
use rustdb_query::QueryMatcher;
use rustdb_storage::OpType;
use tracing::debug;
use crate::context::CommandContext;
@@ -171,6 +172,16 @@ async fn delete_matching(
.await
.map_err(|e| CommandError::StorageError(e.to_string()))?;
// Record in oplog.
ctx.oplog.append(
OpType::Delete,
db,
coll,
&id_str,
None,
Some(doc.clone()),
);
// Update index engine.
if let Some(mut engine) = ctx.indexes.get_mut(ns_key) {
engine.on_delete(doc);