Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext
pipeline_request::add_execute_range

Adds a stage that executes a prepared statement.

Synopsis
pipeline_request&
add_execute_range(
    statement stmt,
    span< const field_view > 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_range(stmt, params) has effects equivalent to conn.execute(stmt.bind(params.begin(), params.end())).

This function can be used instead of add_execute when the number of actual parameters of a statement is not known at compile time.

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 params.size() != stmt.num_params()

Preconditions

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

Object lifetimes

The params range is copied into the request and needs not be kept alive after this function returns.


PrevUpHomeNext