SELECT queries; including joins, subqueries and CTEs.
First create a query builder instance:
where
Adds aWHERE condition. Multiple calls to this method result in the conditions AND-ed together.
subquery
innerJoin
INNER JOINs a table. Does not select columns from the joined table. Supports joining by relation, condition or sql.
innerJoinAndSelect
INNER JOINs a table. Selects columns from the joined table. Supports joining by relation, condition or sql.
innerJoinAndMap
INNER JOINs a table. Selects and maps columns from the joined table into entity result. Supports joining by relation, condition or sql.
with
Adds a CTE which you can reference later in your query. First argument is CTE name, second is CTE query.orderBy
AddsORDER BY clause. Default is ASC.
getEntities
Returns result parsed into .getRaw
Returns result as plain objects. Field names are column name as from theSQL query. Return type is automatically generated.