Expand description
Embeddable property-graph database with an openCypher query subset: single binary, single file, optional in-memory mode.
let db = marsdb::Database::in_memory().unwrap();
db.execute("CREATE (a:Person {name: 'Alice'})-[:KNOWS]->(b:Person {name: 'Bob'})").unwrap();
let result = db.execute("MATCH (n:Person) RETURN n.name").unwrap();
assert_eq!(result.rows.len(), 2);Modules§
- temporal
- Calendar math and ISO-8601 text conversion for
PropertyValue::Date/PropertyValue::Duration– kept out ofmarsdb-graphdeliberately (that crate stores the value, it doesn’t know Cypher’s construction/ formatting rules – seePropertyValue’s own doc comment) and out ofexecutor.rs(which owns dispatching to these, not the arithmetic itself, matching the splitapply_arith/comparealready have from e.g. the planner).
Structs§
- Cancellation
Token - Cooperative cancellation handle for a running query. Clone it before
execution and call
cancelfrom another thread. - Database
- Execution
Event - Execution
Observer - Dependency-free callback adapter for sending execution events to an application’s logger, metrics collector, or tracing system.
- Execution
Options - Per-statement safety limits and optional telemetry. Limit fields default
to
None, preserving unlimited behavior for trusted embedded callers. - Integrity
Report - Successful physical and logical integrity-check summary.
- Procedure
Signature - A procedure’s declared shape – everything
Executorneeds to validate aCALLat the point it’s about to run (arity, coarse argument-type compatibility, output column names forYIELD), before ever askingProcedureProvider::callto actually produce rows. - Procedures
Arc<dyn ProcedureProvider>wrapper – same “manualDebug, derivedClone” shapeexecutor::ExecutionObserveralready uses for its ownArc<dyn Fn(..)>, soExecutionOptions(which embeds this) can keep deriving both.- Query
Result - Transaction
- Caller-managed atomic unit of work. Any statement error immediately aborts the whole transaction, preventing a later accidental commit of partial statement effects.
Enums§
- Error
- Execution
Outcome - Coarse, stable outcome category for telemetry. Error messages and query text are deliberately excluded to avoid leaking user data through an observer by default.
- Literal
- Path
Elem - One element of a
Value::Path— a path isnode, edge, node, edge, ..., node, alternating, as a singleVec, not two parallel node/edge vecs (which would create an unenforcednodes.len() == edges.len() + 1invariant across every place a path gets built or read). - Property
Value - A node/edge property, as persisted to redb (via
postcard, seeencode.rs) and used directly as MarsDB’s runtime scalar type – there is no separate “wire” representation. New variants append at the end (postcard’s derive encodes an enum discriminant by declaration order), never reorder/remove an existing one, or every already-stored property silently decodes as the wrong variant. - TzId
- A
DateTime’s zone: a fixed UTC offset, or a named IANA timezone (Europe/Stockholm) whose real offset varies by instant (DST) and is resolved on demand, not stored – seePropertyValue::DateTime’s doc comment. - Value
Traits§
- Procedure
Provider - Implemented by whatever embeds MarsDB to make
CALLresolve to real behavior.Executorcallssignatureonce perCALL(for compile- time-shaped validation) andcallonce per input row (standalone: once total, since there’s no input row to iterate).