WeaveKit Docs

Validation

What the engine checks at build time, and where custom rules belong.

Validation comes from a few places. Reach for the cheapest one that fits; only fall back to a server hook when nothing declarative does.

NeedMechanism
primitive shape (string/number/boolean/date) + min/max/length/regex/precisionbuilt-in field type (declarative)
required / uniquerequired / unique (column UNIQUE) / object constraints
custom local rulea registered type's pure validate hook (any base)
value from a data set (codes, stringified)enum + options.from
reference to an entity (navigate/join)relation / multiRelation
cross-field / state / aggregate / bespoke DB ruleserver hook validate

Build-time rules

  • Object and field names must be snake_case.
  • Every object declares at least one primary scalar field (several = a composite key). The object name is the table name.
  • relation / details / multiRelation targets must exist. The check runs across the whole set (buildGraph).
  • Details children cannot declare the reserved parent_* columns.
  • Formula fields cannot be required / unique / primary, and cannot have constraints.
  • read/manage: own requires an ownership field; department requires a department or ownership field — see RBAC.

Computed fields

A formula on a scalar field computes a read-only value on write — see Formulas.

On this page