- Build select
- Limit select
- Offset select
- Build select
Build select
To build select use orm::Query
class. For example:
struct ObjectModel
{
int id;
std::string name;
std::string email;
std::string password;
std::string created_at;
std::string updated_at;
};
A template class representing a select query in the ORM framework.
Definition query.hpp:20
it is builder class so you can chain methods:
select.
limit(10).offset(10);
auto limit(std::size_t limit) -> Query< T > &
Sets the LIMIT clause for the select query.
Definition query.hpp:55
Limit select
To limit select use limit
method:
Offset select
To offset select use offset
method:
auto offset(std::size_t offset) -> Query< T > &
Sets the OFFSET clause for the select query.
Definition query.hpp:43
Build select
To build select use buildQuery
method, it will return string with select:
auto queryString = select.buildQuery();