Cypher Language Reference
MarsDB implements a subset of Cypher. It passes the full openCypher
TCK. Exhaustive breakdown: CYPHER_COVERAGE.md.
Supported
- Patterns:
MATCH/OPTIONAL MATCH, undirected/bracketless/multi-type/ variable-length relationship patterns, named-path capture (including over variable-length hops),shortestPath(), pattern comprehension, pattern predicates. - Reading & filtering:
WHERE(property/identity/label comparisons, pattern predicates,STARTS WITH/ENDS WITH/CONTAINS),exists { ... }(both the simple pattern form and the full nested-subquery form, including nestedexists {}),UNWIND, any number of chainedWITHboundaries,ORDER BY/SKIP/LIMIT,DISTINCT. - Writing:
CREATE,MERGE(withON CREATE/ON MATCH),SET,REMOVE,DELETE/DETACH DELETE,MATCH ... CREATE, arbitrary chaining of mutating clauses via trailingWITHorRETURN.MERGEis capped at one relationship hop. - Aggregation: implicit
GROUP BY,count/sum/avg/min/max/collect/percentileCont/percentileDisc,DISTINCTinside an aggregate call, aggregate expressions composed with arithmetic. - Functions: the standard scalar/string/math/list function set
(
coalesce,toInteger/toFloat/toString/toBoolean,keys/labels/type/properties/id,size/length/nodes/relationships/head/tail/last/range,toUpper/toLower/trim/replace/split/substring,abs/ceil/floor/round/sqrt/sign). - Temporal types:
Date/LocalTime/Time/LocalDateTime/DateTime/Duration— construction from strings, maps, or another temporal value; comparison; calendar-aware arithmetic; full component access; ISO-8601 string round-tripping. - Stored procedures:
CALL proc(args) [YIELD ...], both standalone and in-query forms, against a caller-suppliedProcedureProvider— see Embedding in Rust. MarsDB itself ships no built-in procedures. - Parameters:
$namescalars, lists (including nested lists), and maps.
Known limitations
- Node/relationship-valued
$parametersaren’t supported. Scalar, list, and map parameters already work. This is on the roadmap. - No cost-based query optimizer. Index seeks and top-k
ORDER BY ... LIMITselection exist, but join/traversal ordering isn’t cost-estimated. See Architecture. This is on the roadmap. CALLneeds an embedder-suppliedProcedureProvider— there’s no built-in procedure catalog.
Conformance testing
Checked against the
openCypher Technology Compatibility Kit (TCK)
on every push: 3,880/3,880 scenarios pass across 220 feature files.
Per-category numbers are in
CYPHER_COVERAGE.md.
git submodule update --init marsdb-tck/openCypher
cargo run --release -p marsdb-tck