Repository navigation
DSL Reference
Daniele Zucchelli edited this page Aug 16, 2026
·
3 revisions
This page reflects the exported types in the supplied repository snapshot.
compile(db, request, user, role, structure, options?): Promise<CompileResult>| Parameter | Type | Meaning |
|---|---|---|
db |
Database | Transaction |
Supported Drizzle database or transaction |
request |
Request |
Single structured query or phase collection |
user |
any |
Application-provided session context |
role |
string |
Role key used to select permissions |
structure |
Structure |
Table, endpoint, and policy map |
options |
BuildWhereOptions |
Currently includes disable_triggers?
|
type Structure = Record<string, TableStructure>;
type TableStructure = {
endpoints: Endpoint[];
table: any;
};type EndpointType = "GET" | "PUT" | "POST" | "DELETE";
type Endpoint = {
type: EndpointType;
triggers?: TriggerStructure[];
[role: string]: RolePermissions | typeof NONE | any;
};type RolePermissions = {
allowed: FieldPermission; // alias: allow
disallowed?: FieldPermission; // alias: deny
limit?: number;
order_by?: string[] | string;
group_by?: string[] | string;
returning?: /* field permission object */;
};type FieldPermission =
| string
| string[]
| { field: string | string[]; where?: WhereCondition };Presets:
ALL = { allowed: ["*"], disallowed: [] }
ALL_EXCEPT_ID = { allowed: ["*"], disallowed: ["id"] }
NONE = { allowed: [], disallowed: [] }type Request = StructuredQuery | { phases: QueryPhase[] };
type StructuredQuery = {
table: keyof Structure;
type: EndpointType;
select?: string[] | string;
join?: Join[];
where?: WhereCondition;
data?: Record<string, any> | Record<string, any>[];
group_by?: string[] | string;
order_by?: string[] | string;
returning?: string[] | string;
limit?: number;
};type Join = {
table: keyof Structure;
type: "INNER" | "LEFT";
on: Record<string, string> | WhereCondition;
};{ and: [condition, condition] }
{ or: [condition, condition] }
{ not: condition }
{ if: { when: condition, do: condition | boolean, else: condition | boolean } }do and else also accept structured queries or functions in the exported type, but function and structured-query actions are rejected when used as a SQL where condition. Treat action context carefully.
type QueryPhase = {
mode: "TRANSACTION" | "QUERY";
queries: StructuredQuery[];
};See Operators, Errors and Results, and Triggers and Extensibility.
VoidQL is experimental and under active development · Documentation home · Status & limitations
Start Here
Learn & Build
- Learn VoidQL
- Build with VoidQL
- Query Operations
- Authorization Patterns
- Validation & Workflows
- Triggers & Extensibility
Use & Reference
Internals & Project