The Query class provides building robust composable query builder for retrieving and manipulate data.
Generally (but not necessary), its easiest to define a shortcut variable at the top level of your application.
The query object can be composed and manipulated before being used.
Query methods
where
or_where
select
limit
offset
order_by
join
distinct
group_by
preload
Nested grouped queries
and
With a block:
With multiple query objects:
Would both produce the same query from Repo.all(User, query)
:
or
With a block:
With multiple query objects:
Would both produce the same query from Repo.all(User, query)
: