OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
oxy::context::push_fn Struct Reference

A function object that pushes rows into a database context as a coroutine, allowing for dynamic insertion of data. More...

#include <context.hpp>

Public Types

using coro_t = boost::coroutines2::coroutine<param_t>
using param_t = std::vector<std::string>

Public Member Functions

auto operator() (context_t const &ctx, size_t placeholders) const -> coro_t::push_type

Detailed Description

A function object that pushes rows into a database context as a coroutine, allowing for dynamic insertion of data.

The push_fn struct defines a function call operator that takes a context_t and the number of placeholders as parameters. It returns a coroutine that allows for pushing rows into the specified context. The coroutine yields a vector of strings representing the values to be inserted into the database, corresponding to the placeholders defined in the query.

Member Function Documentation

◆ operator()()

auto oxy::context::push_fn::operator() ( context_t const & ctx,
size_t placeholders ) const -> coro_t::push_type
Parameters
ctx- The database context into which to push rows.
placeholders- The number of placeholders in the query for which values will be provided.
Returns
A coroutine push type that allows for pushing rows into the specified context.