On the class the values are functions, called with this bound to the
instance — the place for a rule that spans columns, which no per-column rule
can express. A validator reports by throwing:
`@Validate`({ endsAfterStart() { if (this.endsAt <= this.startsAt) thrownewError('endsAt must be after startsAt'); }, }) classEventextendsModel {}
Applying it twice merges, so rules can be split across lines or inherited
from a base class.
Attach validation rules — to one field, or to the whole model.
On a property the rules are per-column, and run before every insert and update:
On the class the values are functions, called with
thisbound to the instance — the place for a rule that spans columns, which no per-column rule can express. A validator reports by throwing:Applying it twice merges, so rules can be split across lines or inherited from a base class.