mdcs-db 0.1.0

Database layer for the Carnelia MDCS - Document API with collaborative features
Documentation

mdcs-db

Database layer for the MDCS (Merkle-Delta CRDT Store).

This crate provides:

  • Document-based API with path operations
  • Collaborative text (RGAText, RichText)
  • JSON/Object CRDT for flexible schemas
  • Presence and awareness for real-time collaboration
  • Undo/Redo support

Example

use mdcs_db::{DocumentStore, DocumentId, JsonValue};

let mut store = DocumentStore::new("replica_1");

// Create a text document
let doc_id = store.create_text("My Document");
store.text_insert(&doc_id, 0, "Hello World").unwrap();

// Create a JSON document
let json_id = store.create_json("Config");
store.json_set(&json_id, "name", JsonValue::String("Test".into())).unwrap();

// Rich text with formatting
let rich_id = store.create_rich_text("Formatted");
store.rich_text_insert(&rich_id, 0, "Bold text").unwrap();
store.rich_text_bold(&rich_id, 0, 4).unwrap();