|
OXY API 1.0
OXY API Library Documentation
|
A function object that pulls rows from a database context as a coroutine, optionally filtering results and selecting specific columns. More...
#include <context.hpp>
Public Types | |
| using | coro_t = boost::coroutines2::coroutine<result_t> |
| using | result_t = std::map<std::string, std::string> |
Public Member Functions | |
| auto | operator() (context_t const &ctx, filter_t const &filter, std::string const &columns="*") const -> coro_t::pull_type |
| auto | operator() (context_t const &ctx, std::string const &columns="*") const -> coro_t::pull_type |
A function object that pulls rows from a database context as a coroutine, optionally filtering results and selecting specific columns.
The pull_fn struct defines two overloads of the function call operator. The first overload retrieves all rows from the specified context, while the second overload allows for filtering based on a provided filter_t object. Both overloads return a coroutine that yields a map of column names to their corresponding values for each row retrieved.
| auto oxy::context::pull_fn::operator() | ( | context_t const & | ctx, |
| filter_t const & | filter, | ||
| std::string const & | columns = "*" ) const -> coro_t::pull_type |
| ctx | - The database context from which to pull rows. |
| filter | - The filter to apply when retrieving rows. |
| columns | - A string specifying which columns to retrieve (default is "*", meaning all columns). |
| auto oxy::context::pull_fn::operator() | ( | context_t const & | ctx, |
| std::string const & | columns = "*" ) const -> coro_t::pull_type |
| ctx | - The database context from which to pull rows. |
| columns | - A string specifying which columns to retrieve (default is "*", meaning all columns). |