Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
connection::async_start_statement_execution (2 of 4 overloads)

(Deprecated - will be removed in Boost 1.86) Starts a statement execution as a multi-function operation.

Synopsis
template<
    class WritableFieldTuple,
    class CompletionToken,
    class EnableIf = typename std::enable_if<detail::is_writable_field_tuple<WritableFieldTuple>::value>::type>
auto
async_start_statement_execution(
    const statement& stmt,
    WritableFieldTuple&& params,
    execution_state& st,
    diagnostics& diag,
    CompletionToken&& token);
Description

Writes the execute request and reads the initial server response and the column metadata, but not the generated rows or subsequent resultsets, if any. After this operation completes, st will have execution_state::meta populated. Metadata will be populated according to this->meta_mode().

If the operation generated any rows or more than one resultset, these must be read (by using read_some_rows and read_resultset_head) before engaging in any further network operation. Otherwise, the results are undefined.

The statement actual parameters (params) are passed as a std::tuple of elements. String parameters should be encoded using the connection's character set.

Deprecation warning

This function is deprecated and will be removed in Boost 1.86. Please use execute or async_execute instead.

Preconditions

stmt.valid() == true

Object lifetimes

If CompletionToken is deferred (like use_awaitable), and params contains any reference type (like string_view), the caller must keep the values pointed by these references alive until the operation is initiated. Value types will be copied/moved as required, so don't need to be kept alive. It's not required to keep stmt alive, either.

Handler signature

The handler signature for this operation is void(boost::mysql::error_code).


PrevUpHomeNext