ORM C++
Loading...
Searching...
No Matches
orm::Query< T > Class Template Reference

A template class representing a select query in the ORM framework. More...

#include <query.hpp>

Public Member Functions

 Query ()
 Constructs a Query object.
 
auto where (const query::Condition &condition) -> Query< T > &
 Where clause.
 
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.
 

Friends

class orm::Database
 Database class is a friend class of Query for access to the query data.
 

Detailed Description

template<typename T>
class orm::Query< T >

A template class representing a select query in the ORM framework.

This class provides functionality for building a select query.

Template Parameters
TThe type of the query.

Member Function Documentation

◆ disableJoining()

template<typename T >
auto orm::Query< T >::disableJoining ( ) -> Query<T>&
inline

Disables joining for the select query.

Note
Only ids fields will be set in related models.
Returns
A reference to the QueryBuilder object.

◆ limit()

template<typename T >
auto orm::Query< T >::limit ( std::size_t limit) -> Query<T>&
inline

Sets the LIMIT clause for the select query.

Parameters
limitThe maximum number of rows to return.
Returns
A reference to the QueryBuilder object.

◆ offset()

template<typename T >
auto orm::Query< T >::offset ( std::size_t offset) -> Query<T>&
inline

Sets the OFFSET clause for the select query.

Parameters
offsetThe number of rows to skip.
Returns
A reference to the QueryBuilder object.

◆ where()

template<typename T >
auto orm::Query< T >::where ( const query::Condition & condition) -> Query<T>&
inline

Where clause.

Parameters
condition

The documentation for this class was generated from the following file: