Expand description
cyrs-schema — the schema surface consumers implement (spec 0001 §8).
This crate defines the SchemaProvider trait and its supporting
types. It has no runtime behaviour: it exists so the cyrs-sema
pass and the LSP can consult a consumer-owned schema without the
consumer pulling Cypher-internal types.
Consumers implement SchemaProvider against their own storage
(graph database catalog, TOML spec, JSON document, etc.). The crate
intentionally says nothing about where schema data comes from.
§Invariants
SchemaProvider::schema_digestis a content-addressed fingerprint. Must change on every observable schema change; must be stable across identical schemas. Used as a Salsa input (spec §11.2).- Label, relationship-type, and property names are Cypher-identifier strings. Escaping is the caller’s responsibility.
Modules§
- diff
- Schema diff (spec 0002 §9, §12).
- file
- TOML schema-file loader and round-trip serialiser (spec 0002).
- lint
- Schema-file linter (spec 0002 §9).
Structs§
- Empty
Schema - A
SchemaProviderthat reports nothing. Useful for schema-free mode and for unit tests that do not want to construct a full schema. - Endpoint
Decl - Declared endpoint shape for a relationship type.
- FnCategories
- Purity / determinism / aggregation flags for a function. The
sema pass uses these to decide which syntactic positions a
function may appear in (aggregates in
RETURN, pure functions inWHERE, etc.). - Function
Signature - A function catalog entry.
- InMemory
Schema - A concrete, in-memory
SchemaProvider. - InMemory
Schema Builder - Builder for
InMemorySchema. - Param
Decl - A single parameter of a function or procedure signature.
- Procedure
Signature - A procedure signature. Procedures have a mode and a
YIELDcolumn list in addition to inputs. - Property
Decl - A declared property on a label or relationship type.
- RelDecl
- A declared relationship type. The file-format counterpart to
EndpointDecl: one rel type may permit many(start, end)label pairings, all at many-to-many at v0 (spec 0002 §6). - Standard
Library - The openCypher built-in function catalog as a
SchemaProvider. - Yield
Decl - A single output column of a
YIELDclause on a procedure call.
Enums§
- Builder
Error - Errors produced by
InMemorySchemaBuilder::build. - Cardinality
- Relationship multiplicity between two label endpoints.
- Proc
Mode - Procedure access mode (spec §8.2). Used by sema to gate procedures in read-only contexts.
- Property
Type - The propertable-value type language. Intentionally simpler than the full Cypher value type — schemas describe what values are stored.
- Return
Ty - How a function’s return type is computed.
Traits§
- Schema
Provider - The single trait consumers implement to feed schema into the front-end.
Type Aliases§
- Dynamic
Return Fn - Closure type for dynamic return-type inference.