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

View File

@@ -2,6 +2,7 @@ use std::collections::HashMap;
use bson::{doc, oid::ObjectId, Bson, Document};
use rustdb_index::IndexEngine;
use rustdb_storage::OpType;
use tracing::{debug, warn};
use crate::context::CommandContext;
@@ -63,7 +64,17 @@ pub async fn handle(
// Attempt storage insert.
match ctx.storage.insert_one(db, coll, doc.clone()).await {
Ok(_id_str) => {
Ok(id_str) => {
// Record in oplog.
ctx.oplog.append(
OpType::Insert,
db,
coll,
&id_str,
Some(doc.clone()),
None,
);
// Update index engine.
let mut engine = ctx
.indexes