Repository navigation
Validation and Workflows
VoidQL conditions can refer to incoming data and contextual values, allowing authorization to depend on the requested mutation.
Use $data.<table>.<field> in policy expressions where the engine expects a resolved value. The repository examples also exercise contextual tokens for user and trigger-stage data.
{
if: {
when: {
left_value: "$data.orders.status",
operator: "=",
value: "approved"
},
do: {
field: "orders.status",
operator: "=",
value: "submitted"
},
else: false
}
}This represents a transition rule: requesting approved is allowed only when the existing row is submitted.
- Enumerate allowed transitions explicitly.
- Compare the proposed value with
$data. - Constrain the current row using a column condition.
- Scope the row to its tenant or owner.
- Reject the default branch.
- Test stale-state and concurrent-update behavior against the actual database.
The current code returns generic thrown errors rather than a stable, typed error taxonomy. Applications should avoid exposing raw error messages to untrusted clients and should map failures to their own API error contract.
Important
VoidQL policy checks complement database constraints; they do not replace NOT NULL, unique, foreign-key, check constraints, or transaction isolation appropriate to the domain.
Start Here
Learn & Build
- Learn VoidQL
- Build with VoidQL
- Query Operations
- Authorization Patterns
- Validation & Workflows
- Triggers & Extensibility
Use & Reference
Internals & Project