Optional_complexOptional_joinOptional_simpleCompute an aggregate for the active query.
SQL aggregate function identifier (e.g., AVG).
Resolved field/column name to aggregate.
Numeric aggregate result or null when no rows match.
Build an aggregate query (AVG, COUNT, etc.) for the current predicates.
Aggregate function keyword.
Fully qualified column expression.
SQL fragment plus bound params.
Calculate the average for a column.
Column to aggregate.
Numeric average or null when no rows satisfy the predicates.
Filter by date range
Start date
End date
Options (leftBound, rightBound)
This instance for chaining
Filter by array contains (for PostgreSQL arrays)
Field name
Value to check for
This instance for chaining
Filter by JSONB field contains
JSONB field name
Value to check for
This instance for chaining
Execute query and return count
Result count
Delete records matching the query
Delete result
Delete a record by ID
Record ID
Delete result
Filter by revision date range
Start date (inclusive)
End date (inclusive)
This instance for chaining
Filter by revision tags
Tag or array of tags to filter by
This instance for chaining
Filter by revision user
User ID who created the revision
This instance for chaining
Finally handler for Promise-like usage
OptionalonFinally: () => voidFinally handler
Promise resolving to query results
Get all revisions of a specific document (including old and deleted)
The document ID to get revisions for
This instance for chaining
Add JOIN clauses with support for complex joins
Join specification
This instance for chaining
Filter by field existence in JSONB
JSONB field name
Key to check for existence
This instance for chaining
Include sensitive fields in query results
Array of sensitive field names to include
This instance for chaining
Atomically increment a numeric column on rows matching the current predicate.
Model field (resolved to a DB column) to increment
Increment step (default: 1)
Optional returning clause
Rows matched/returned plus affected row count.
Add LIMIT clause
Limit count
This instance for chaining
Add OFFSET clause
Offset count
This instance for chaining
Add ORDER BY clause
Field to order by
Sort direction (ASC/DESC)
This instance for chaining
Get a random sample of records
Number of records to sample
Array of sampled records
Filter by membership in a list of values using PostgreSQL ANY
Field name
Values to match
Optionaloptions: { cast?: string } = {}Additional options
Optionalcast?: stringOptional cast to apply to the parameter (e.g., 'uuid[]')
This instance for chaining
Add a predicate against a column on a joined relation. This will ensure the relation is joined and apply a WHERE clause to the related table using camelCase field names.
Relation key from the manifest
CamelCase field on the related model
Comparison operator (defaults to '=')
Comparison value
Fluent query builder for the PostgreSQL DAL.
Produces parameterized SQL for SELECT/COUNT/DELETE with support for predicates, ordering, pagination, and both simple and complex joins. Instances are model-aware (leveraging table/column metadata) and implement Promise-like behavior so they can be awaited directly.