Execute the query and return results. Implementation depends on the specific loader type.
Execute the query and return results.
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.
Order 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.
query.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
SQL query builder implementation for AuthorizationResultBasedKnexEntityLoader.