pub struct CompositeUnique {
pub entries: Vec<RustSafeName>,
}Expand description
ONE <db>(unique(a, b, …)) — a COMPOSITE unique constraint, resolved to this database’s own
column names.
§It is SQL’s and it is per DATABASE, which is why it is not on Storage
Storage is what every backend carries. A composite unique is not: this crate’s mongo emission
renders a collection and builds no index, so the word is refused there BY NAME rather than
carried and dropped — see composite_unique in ingraph-derive. Holding the list on the three
SQL structs is the same split MongoDatabase already makes for schema: mongo’s vocabulary is
not SQL’s, and now it cannot be given SQL’s.
§The entries are COLUMN names, and the audit is already spent
What the declaration wrote are FIELD idents. By the time one is here it has been held against
this database’s own column list — every entry names a field this record declares, this database
carries, and stores in a column of the row — so the emission reads this list and asks nothing.
A rename is already applied, because it is the emitted name that reaches a CREATE UNIQUE INDEX and a check on the Rust name would walk straight past one.
Fields§
§entries: Vec<RustSafeName>The columns the constraint is over, in the order the declaration wrote them — which is the order the index carries them, a composite index being answerable by a leading prefix.