Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
Loading...
Searching...
No Matches
orm::QueryBuilder< DBClient, ModelType > Class Template Reference

A lightweight, JSON-backed ORM Query Builder. More...

#include <QueryBuilder.hpp>

Public Member Functions

 QueryBuilder (std::shared_ptr< DBClient > db, const std::string &table)
 
QueryBuilderwhere (const std::string &field, const std::string &op, const std::string &val)
 Adds a WHERE clause using an explicit field, operator, and value.
 
QueryBuilderwhere (const Expr &expr)
 
QueryGetAwaiter< DBClient, ModelType > get_async ()
 Executes a SELECT query asynchronously and maps results to a vector of ModelType.
 
QueryInsertAwaiter< DBClient, ModelType > insert_async (const ModelType &model)
 Executes an INSERT query for a model.
 

Detailed Description

template<typename DBClient, typename ModelType>
class orm::QueryBuilder< DBClient, ModelType >

A lightweight, JSON-backed ORM Query Builder.

Constructor & Destructor Documentation

◆ QueryBuilder()

template<typename DBClient , typename ModelType >
orm::QueryBuilder< DBClient, ModelType >::QueryBuilder ( std::shared_ptr< DBClient >  db,
const std::string &  table 
)
inline

Member Function Documentation

◆ get_async()

template<typename DBClient , typename ModelType >
QueryGetAwaiter< DBClient, ModelType > orm::QueryBuilder< DBClient, ModelType >::get_async ( )
inline

Executes a SELECT query asynchronously and maps results to a vector of ModelType.

◆ insert_async()

template<typename DBClient , typename ModelType >
QueryInsertAwaiter< DBClient, ModelType > orm::QueryBuilder< DBClient, ModelType >::insert_async ( const ModelType &  model)
inline

Executes an INSERT query for a model.

◆ where() [1/2]

template<typename DBClient , typename ModelType >
QueryBuilder & orm::QueryBuilder< DBClient, ModelType >::where ( const Expr expr)
inline

◆ where() [2/2]

template<typename DBClient , typename ModelType >
QueryBuilder & orm::QueryBuilder< DBClient, ModelType >::where ( const std::string &  field,
const std::string &  op,
const std::string &  val 
)
inline

Adds a WHERE clause using an explicit field, operator, and value.


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