Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
pipeline_request::add_execute (2 of 2 overloads)

Adds a stage that executes a prepared statement.

Synopsis
template<
    class... WritableField>
pipeline_request&
add_execute(
    statement stmt,
    const WritableField&... params);
Description

Creates a stage that runs stmt bound to any parameters passed in params, like any_connection::execute and statement::bind. For example, add_execute(stmt, 42, "John") has effects equivalent to conn.execute(stmt.bind(42, "John")).

Exception safety

Strong guarantee. Throws if the supplied number of parameters doesn't match the number of parameters expected by the statement. Additionally, memory allocations may throw.

Exceptions

Type

Thrown On

std::invalid_argument

If sizeof...(params) != stmt.num_params()

Preconditions

The passed statement should be valid (stmt.valid() == true).

Object lifetimes

Any objects pointed to by params are copied into the request and need not be kept alive after this function returns.

Type requirements

Any type satisfying WritableField can be used as a parameter. This includes all types that can be used with statement::bind, including scalar types, strings, blobs and optionals.


PrevUpHomeNext