Skip to main content

Crate cyrs_schema

Crate cyrs_schema 

Source
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_digest is 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§

EmptySchema
A SchemaProvider that reports nothing. Useful for schema-free mode and for unit tests that do not want to construct a full schema.
EndpointDecl
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 in WHERE, etc.).
FunctionSignature
A function catalog entry.
InMemorySchema
A concrete, in-memory SchemaProvider.
InMemorySchemaBuilder
Builder for InMemorySchema.
ParamDecl
A single parameter of a function or procedure signature.
ProcedureSignature
A procedure signature. Procedures have a mode and a YIELD column list in addition to inputs.
PropertyDecl
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).
StandardLibrary
The openCypher built-in function catalog as a SchemaProvider.
YieldDecl
A single output column of a YIELD clause on a procedure call.

Enums§

BuilderError
Errors produced by InMemorySchemaBuilder::build.
Cardinality
Relationship multiplicity between two label endpoints.
ProcMode
Procedure access mode (spec §8.2). Used by sema to gate procedures in read-only contexts.
PropertyType
The propertable-value type language. Intentionally simpler than the full Cypher value type — schemas describe what values are stored.
ReturnTy
How a function’s return type is computed.

Traits§

SchemaProvider
The single trait consumers implement to feed schema into the front-end.

Type Aliases§

DynamicReturnFn
Closure type for dynamic return-type inference.