Repository navigation
Understand the Engine
| Module | Responsibility |
|---|---|
src/index.ts |
Public compile flow, phase batching, endpoint resolution, orchestration |
src/rbac.ts |
Field resolution, value tokens, table map extraction, field validation, aggregates |
src/drizzle.ts |
Condition construction, joins, CRUD operations, triggers |
src/types.ts |
Public and internal TypeScript shapes and permission presets |
The engine resolves the table and endpoint first. It selects the role permission branch, builds policy row constraints, validates request fields, resolves data, and builds an executable Drizzle operation.
compile() does not expose a SQL string as its public result. It returns { execute }. Some validation and plan construction happen before execute; the database operation and transactional trigger lifecycle happen during execute.
Each main operation is wrapped in db.transaction. A TRANSACTION phase builds its queries against a shared transaction. A QUERY phase executes plans independently while collecting failures.
The selected endpoint must exist, the role key must be present, and its permission value must be object-shaped. Policy and request where conditions are combined with logical AND.
Requested fields are checked against both the Drizzle table map and endpoint permissions. Joined-table fields are evaluated against the joined table's endpoint and role configuration.
The resolver supports contextual tokens used in repository examples, including user, request data, column, and trigger-stage values. Because the token grammar is not yet published as a stable contract, prefer tested examples and avoid undocumented variants.
- Drizzle remains the SQL construction and driver abstraction layer.
- Authorization constraints are composed before execution.
- Role configuration is colocated with each table operation.
- The plan/execution split allows validation before the operation runs.
- Triggers execute within the database transaction.
For contributor setup, continue to Develop VoidQL.
Start Here
Learn & Build
- Learn VoidQL
- Build with VoidQL
- Query Operations
- Authorization Patterns
- Validation & Workflows
- Triggers & Extensibility
Use & Reference
Internals & Project