Skip to main content

Module composite_unique

Module composite_unique 

Expand description

Parsing for the model-level @@unique([...], where: "...") composite unique attribute (Prisma’s spelling for the field list, extended with a partial-index predicate by cratestack#742). Its bracketed field-list syntax is shared with @@index([...])/@@id([...]) only via [super::field_list::is_valid_field_name] (the identifier rule) — the split/keyword-argument parsing itself is shared with @@index([...], where: "...") (cratestack#156) through [super::attribute_syntax] instead, since unlike @@id([...]) this attribute also takes a trailing where: keyword argument. What differs from @@id([...])’s plain form is the semantics — a composite unique constraint, not the primary key — and the error text pointing at the single-field alternative.

Structs§

ParsedCompositeUnique
The parsed shape of an @@unique([...], where: "...") attribute.

Functions§

parse_composite_unique_attribute
Parses @@unique([field1, field2, ...], where: "...") into its ordered list of local field names plus an optional partial-index predicate. Callers are responsible for checking that each name resolves to a real scalar field on the model.