Execute the query and return results. Implementation depends on the specific loader type.
Execute the query and return results.
Lock the selected rows in share mode using SELECT ... FOR SHARE. The lock is held until the
end of the transaction, so the query must be executed in a transactional query context.
Mutually exclusive with forUpdate.
Lock the selected rows for update using SELECT ... FOR UPDATE. The lock is held until the
end of the transaction, so the query must be executed in a transactional query context.
Mutually exclusive with forShare.
ProtectedgetGet the current modifiers as QuerySelectionModifiersWithOrderByFragment
ProtectedgetGet the SQL fragment
Limit the number of results
Skip a number of results
Order by a field. Can be called multiple times to add multiple order bys.
Optionalnulls: NullsOrderingOrder by a SQL fragment expression. Provides type-safe, parameterized ORDER BY clauses
The SQL fragment to order by. Must not include the ASC/DESC keyword, as ordering direction is determined by the order parameter.
The ordering direction (ascending or descending). Defaults to ascending.
Optionalnulls: NullsOrderingquery.orderByFragment(
sql`(data->>'createdAt')::timestamp`,
OrderByOrdering.DESCENDING,
);
// Generates ORDER BY clause that orders by the createdAt field in the JSONB data column, cast to a timestamp, in descending order.
// Note that the SQL fragment is parameterized, so it is safe from SQL injection.
// The generated SQL would look like: ORDER BY (data->>'createdAt')::timestamp DESC
Skip rows that are already locked by another transaction using SKIP LOCKED instead of waiting for them.
Requires forUpdate() or forShare().
SQL query builder implementation for AuthorizationResultBasedKnexEntityLoader.