|
ORM C++
|
A template class representing a select query in the ORM framework. More...
Public Member Functions | |
| Query ()=default | |
| Constructs a Query object. | |
| template<typename P> | |
| auto | where (const P &predicate) -> Query< T > & |
| Replaces the WHERE predicate. | |
| template<typename P> | |
| auto | andWhere (const P &predicate) -> Query< T > & |
| Adds a predicate with AND. | |
| template<typename P> | |
| auto | orWhere (const P &predicate) -> Query< T > & |
| Adds a predicate with OR. | |
| template<typename... Orders> | |
| auto | orderBy (Orders... orders) -> Query< T > & |
| Sets the ORDER BY clauses for the select query. | |
| template<typename... Columns> | |
| auto | groupBy (Columns... columns) -> Query< T > & |
| Sets the GROUP BY columns for the select query. | |
| template<typename P> | |
| auto | having (const P &predicate) -> Query< T > & |
| Replaces the HAVING predicate. | |
| template<typename P> | |
| auto | andHaving (const P &predicate) -> Query< T > & |
| Adds an aggregate predicate with AND. | |
| template<typename P> | |
| auto | orHaving (const P &predicate) -> Query< T > & |
| Adds an aggregate predicate with OR. | |
| auto | distinct () -> Query< T > & |
| Select distinct rows. | |
| auto | offset (std::size_t offset) -> Query< T > & |
| Sets the OFFSET clause for the select query. | |
| auto | limit (std::size_t limit) -> Query< T > & |
| Sets the LIMIT clause for the select query. | |
| auto | disableJoining () -> Query< T > & |
| Disables joining for the select query. | |
| template<auto Member> | |
| auto | include () -> Query< T > & |
| Explicitly loads a mapped OneToMany or ManyToMany collection. | |
Friends | |
| template<typename> | |
| class | orm::OrmContext |
| Database class is a friend class of Query for access to the query data. | |
A template class representing a select query in the ORM framework.
This class provides functionality for building a select query.
| T | The type of the query. |
Definition at line 38 of file select.cppm.
|
default |
Constructs a Query object.
|
inline |
Adds an aggregate predicate with AND.
| predicate | The aggregate predicate. |
Definition at line 140 of file select.cppm.
|
inline |
|
inline |
Disables joining for the select query.
Definition at line 204 of file select.cppm.
|
inline |
Select distinct rows.
Definition at line 168 of file select.cppm.
|
inline |
Sets the GROUP BY columns for the select query.
| columns | The model column paths to group by. |
Definition at line 110 of file select.cppm.
|
inline |
Replaces the HAVING predicate.
| predicate | The aggregate predicate. |
Definition at line 125 of file select.cppm.
Explicitly loads a mapped OneToMany or ManyToMany collection.
Repeating the same include is idempotent. Collection loading is performed after the root SELECT, so root pagination is preserved.
Definition at line 222 of file select.cppm.
|
inline |
Sets the LIMIT clause for the select query.
| limit | The maximum number of rows to return. |
Definition at line 192 of file select.cppm.
|
inline |
Sets the OFFSET clause for the select query.
| offset | The number of rows to skip. |
Definition at line 180 of file select.cppm.
|
inline |
Sets the ORDER BY clauses for the select query.
| orders | The ORDER BY clauses. |
Definition at line 95 of file select.cppm.
|
inline |
Adds an aggregate predicate with OR.
| predicate | The aggregate predicate. |
Definition at line 156 of file select.cppm.
|
inline |
|
inline |
Database class is a friend class of Query for access to the query data.
Definition at line 235 of file select.cppm.