Skip to main content

Module schema

Module schema 

Source
Expand description

Schema IR — the parsed shape of a .cstack file. Every IR node carries source-span back-pointers so consumers can map errors to positions in the original text.

Modules§

composite_key
Parsing for the model-level @@id([...]) composite-primary-key attribute (Prisma’s spelling). Mirrors crate::events::parse_emit_attribute’s shape: syntax parsing lives here in cratestack-core so both the parser’s semantic checker and any other consumer share one implementation. The bracketed-field-list syntax itself is shared with @@unique([...]) — see [super::field_list].
composite_unique
Parsing for the model-level @@unique([...]) composite-unique attribute (Prisma’s spelling). Shares its syntax rules with @@id([...]) via [super::field_list]; what differs is the semantics — a composite unique constraint, not the primary key — and the error text pointing at the single-field alternative.
model
Model / mixin / type / enum / field IR nodes parsed out of a .cstack file. Every IR node carries SourceSpan back-pointers so consumers (parser, LSP, generators) can map errors to source positions.
procedure
Procedure / query-mutation IR nodes parsed out of a .cstack file.
selection
Field selection / include shape used by the column-projection path.
view
View IR — the view <Name> from <Model>, ... { ... } block.

Structs§

Attribute
AuthBlock
ConfigBlock
ConfigEntry
Datasource
EnumDecl
EnumVariant
Field
MixinDecl
Model
OwnedSchemaSummary
Procedure
ProcedureArg
Schema
SchemaSummary
SelectionQuery
SourceSpan
TypeDecl
TypeRef
View
ViewSource

Enums§

ProcedureKind
TransportStyle
Wire-shape the schema generates for. Picked once per schema (via the top-level transport rest|rpc directive) so generated servers and clients only carry one binding’s worth of surface.
TypeArity

Functions§

parse_composite_id_attribute
Parses @@id([field1, field2, ...]) into its ordered list of local field names. Callers are responsible for checking that each name resolves to a real scalar field on the model.
parse_composite_unique_attribute
Parses @@unique([field1, field2, ...]) into its ordered list of local field names. Callers are responsible for checking that each name resolves to a real scalar field on the model.