mirror of
https://github.com/boostorg/mysql.git
synced 2026-02-14 00:42:53 +00:00
Renamed resultset and prepared_statement => bases
This commit is contained in:
@@ -16,8 +16,8 @@
|
||||
#include <boost/mysql/detail/protocol/protocol_types.hpp>
|
||||
#include <boost/mysql/detail/network_algorithms/handshake.hpp>
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/statement_base.hpp>
|
||||
#include <boost/mysql/connection_params.hpp>
|
||||
#include <boost/mysql/execute_params.hpp>
|
||||
#include <boost/mysql/row_view.hpp>
|
||||
@@ -337,32 +337,32 @@ public:
|
||||
* \brief Executes a SQL text query (sync with error code version).
|
||||
* \details See [link mysql.queries this section] for more info.
|
||||
*
|
||||
* After this function has returned, you should read the entire resultset
|
||||
* After this function has returned, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*/
|
||||
void query(boost::string_view query_string, resultset& result, error_code&, error_info&);
|
||||
void query(boost::string_view query_string, resultset_base& result, error_code&, error_info&);
|
||||
|
||||
/**
|
||||
* \brief Executes a SQL text query (sync with exceptions version).
|
||||
* \details See [link mysql.queries this section] for more info.
|
||||
*
|
||||
* After this function has returned, you should read the entire resultset
|
||||
* After this function has returned, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*/
|
||||
void query(boost::string_view query_string, resultset& result);
|
||||
void query(boost::string_view query_string, resultset_base& result);
|
||||
|
||||
/**
|
||||
* \brief Executes a SQL text query (async without [reflink error_info] version).
|
||||
* \details See [link mysql.queries this section] for more info.
|
||||
*
|
||||
* After the operation completes, you should read the entire resultset
|
||||
* After the operation completes, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*
|
||||
* The handler signature for this operation is
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset<Stream>)`.
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset_base<Stream>)`.
|
||||
*/
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::mysql::error_code))
|
||||
@@ -372,7 +372,7 @@ public:
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_query(
|
||||
boost::string_view query_string,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
)
|
||||
{
|
||||
@@ -383,12 +383,12 @@ public:
|
||||
* \brief Executes a SQL text query (async with [reflink error_info] version).
|
||||
* \details See [link mysql.queries this section] for more info.
|
||||
*
|
||||
* After the operation completes, you should read the entire resultset
|
||||
* After the operation completes, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*
|
||||
* The handler signature for this operation is
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset<Stream>)`.
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset_base<Stream>)`.
|
||||
*/
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::mysql::error_code))
|
||||
@@ -398,7 +398,7 @@ public:
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_query(
|
||||
boost::string_view query_string,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
);
|
||||
@@ -409,7 +409,7 @@ public:
|
||||
* Prepared statements are only valid while the connection object on which
|
||||
* this function was called is alive and open.
|
||||
*/
|
||||
void prepare_statement(boost::string_view statement, prepared_statement& result, error_code&, error_info&);
|
||||
void prepare_statement(boost::string_view statement, statement_base& result, error_code&, error_info&);
|
||||
|
||||
/**
|
||||
* \brief Prepares a statement (sync with exceptions version).
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
* Prepared statements are only valid while the connection object on which
|
||||
* this function was called is alive and open.
|
||||
*/
|
||||
void prepare_statement(boost::string_view statement, prepared_statement& result);
|
||||
void prepare_statement(boost::string_view statement, statement_base& result);
|
||||
|
||||
/**
|
||||
* \brief Prepares a statement (async without [reflink error_info] version).
|
||||
@@ -426,7 +426,7 @@ public:
|
||||
* this function was called is alive and open.
|
||||
*
|
||||
* The handler signature for this operation is
|
||||
* `void(boost::mysql::error_code, boost::mysql::prepared_statement<Stream>)`
|
||||
* `void(boost::mysql::error_code, boost::mysql::statement_base<Stream>)`
|
||||
*/
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::mysql::error_code))
|
||||
@@ -436,7 +436,7 @@ public:
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_prepare_statement(
|
||||
boost::string_view statement,
|
||||
prepared_statement& result,
|
||||
statement_base& result,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
)
|
||||
{
|
||||
@@ -450,7 +450,7 @@ public:
|
||||
* this function was called is alive and open.
|
||||
*
|
||||
* The handler signature for this operation is
|
||||
* `void(boost::mysql::error_code, boost::mysql::prepared_statement<Stream>)`
|
||||
* `void(boost::mysql::error_code, boost::mysql::statement_base<Stream>)`
|
||||
*/
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::mysql::error_code))
|
||||
@@ -460,7 +460,7 @@ public:
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_prepare_statement(
|
||||
boost::string_view statement,
|
||||
prepared_statement& result,
|
||||
statement_base& result,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
);
|
||||
@@ -471,15 +471,15 @@ public:
|
||||
* \details
|
||||
* FieldViewCollection should meet the [reflink FieldViewCollection] requirements.
|
||||
*
|
||||
* After this function has returned, you should read the entire resultset
|
||||
* After this function has returned, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*/
|
||||
template <class FieldViewCollection, class EnableIf = detail::enable_if_field_view_collection<FieldViewCollection>>
|
||||
void execute_statement(
|
||||
const prepared_statement& statement,
|
||||
const statement_base& statement,
|
||||
const FieldViewCollection& params,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
@@ -492,15 +492,15 @@ public:
|
||||
* \details
|
||||
* FieldViewCollection should meet the [reflink FieldViewCollection] requirements.
|
||||
*
|
||||
* After this function has returned, you should read the entire resultset
|
||||
* After this function has returned, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*/
|
||||
template <class FieldViewCollection, class EnableIf = detail::enable_if_field_view_collection<FieldViewCollection>>
|
||||
void execute_statement(
|
||||
const prepared_statement& statement,
|
||||
const statement_base& statement,
|
||||
const FieldViewCollection& params,
|
||||
resultset& result
|
||||
resultset_base& result
|
||||
)
|
||||
{
|
||||
return execute_statement(make_execute_params(statement, params), result);
|
||||
@@ -512,14 +512,14 @@ public:
|
||||
* \details
|
||||
* FieldViewCollection should meet the [reflink FieldViewCollection] requirements.
|
||||
*
|
||||
* After this operation completes, you should read the entire resultset
|
||||
* After this operation completes, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
* It is __not__ necessary to keep the collection of parameters or the
|
||||
* values they may point to alive after the initiating function returns.
|
||||
*
|
||||
* The handler signature for this operation is
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset<Stream>)`.
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset_base<Stream>)`.
|
||||
*/
|
||||
template<
|
||||
class FieldViewCollection,
|
||||
@@ -530,9 +530,9 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_execute_statement(
|
||||
const prepared_statement& statement,
|
||||
const statement_base& statement,
|
||||
const FieldViewCollection& params,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
)
|
||||
{
|
||||
@@ -549,14 +549,14 @@ public:
|
||||
* \details
|
||||
* FieldViewCollection should meet the [reflink FieldViewCollection] requirements.
|
||||
*
|
||||
* After this operation completes, you should read the entire resultset
|
||||
* After this operation completes, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
* It is __not__ necessary to keep the collection of parameters or the
|
||||
* values they may point to alive after the initiating function returns.
|
||||
*
|
||||
* The handler signature for this operation is
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset<Stream>)`.
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset_base<Stream>)`.
|
||||
*/
|
||||
template <
|
||||
class FieldViewCollection,
|
||||
@@ -567,9 +567,9 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_execute_statement(
|
||||
const prepared_statement& statement,
|
||||
const statement_base& statement,
|
||||
const FieldViewCollection& params,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
)
|
||||
@@ -590,14 +590,14 @@ public:
|
||||
* The range \\[`params.first()`, `params.last()`) will be used as parameters for
|
||||
* statement execution. They should be a valid iterator range.
|
||||
*
|
||||
* After this function has returned, you should read the entire resultset
|
||||
* After this function has returned, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*/
|
||||
template <class FieldViewFwdIterator>
|
||||
void execute_statement(
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
error_code& ec,
|
||||
error_info& info
|
||||
);
|
||||
@@ -609,14 +609,14 @@ public:
|
||||
* The range \\[`params.first()`, `params.last()`) will be used as parameters for
|
||||
* statement execution. They should be a valid iterator range.
|
||||
*
|
||||
* After this function has returned, you should read the entire resultset
|
||||
* After this function has returned, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*/
|
||||
template <class FieldViewFwdIterator>
|
||||
void execute_statement(
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& result
|
||||
resultset_base& result
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -627,7 +627,7 @@ public:
|
||||
* The range \\[`params.first()`, `params.last()`) will be used as parameters for
|
||||
* statement execution. They should be a valid iterator range.
|
||||
*
|
||||
* After this operation completes, you should read the entire resultset
|
||||
* After this operation completes, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*
|
||||
@@ -636,7 +636,7 @@ public:
|
||||
* values they may point to alive after the initiating function returns.
|
||||
*
|
||||
* The handler signature for this operation is
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset<Stream>)`.
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset_base<Stream>)`.
|
||||
*/
|
||||
template <
|
||||
class FieldViewFwdIterator,
|
||||
@@ -647,7 +647,7 @@ public:
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_execute_statement(
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
)
|
||||
{
|
||||
@@ -662,7 +662,7 @@ public:
|
||||
* The range \\[`params.first()`, `params.last()`) will be used as parameters for
|
||||
* statement execution. They should be a valid iterator range.
|
||||
*
|
||||
* After this operation completes, you should read the entire resultset
|
||||
* After this operation completes, you should read the entire resultset_base
|
||||
* before calling any function that involves communication with the server over this
|
||||
* connection. Otherwise, the results are undefined.
|
||||
*
|
||||
@@ -671,7 +671,7 @@ public:
|
||||
* values they may point to alive after the initiating function returns.
|
||||
*
|
||||
* The handler signature for this operation is
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset<Stream>)`.
|
||||
* `void(boost::mysql::error_code, boost::mysql::resultset_base<Stream>)`.
|
||||
*/
|
||||
template <
|
||||
class FieldViewFwdIterator,
|
||||
@@ -682,7 +682,7 @@ public:
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_execute_statement(
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
);
|
||||
@@ -695,7 +695,7 @@ public:
|
||||
* After calling this function, no further functions may be called on this prepared
|
||||
* statement, other than assignment. Failing to do so results in undefined behavior.
|
||||
*/
|
||||
void close_statement(const prepared_statement&, error_code&, error_info&);
|
||||
void close_statement(const statement_base&, error_code&, error_info&);
|
||||
|
||||
/**
|
||||
* \brief Closes a prepared statement, deallocating it from the server
|
||||
@@ -704,7 +704,7 @@ public:
|
||||
* After calling this function, no further functions may be called on this prepared
|
||||
* statement, other than assignment. Failing to do so results in undefined behavior.
|
||||
*/
|
||||
void close_statement(const prepared_statement&);
|
||||
void close_statement(const statement_base&);
|
||||
|
||||
/**
|
||||
* \brief Closes a prepared statement, deallocating it from the server
|
||||
@@ -722,7 +722,7 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_close_statement(
|
||||
const prepared_statement& stmt,
|
||||
const statement_base& stmt,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
)
|
||||
{
|
||||
@@ -745,7 +745,7 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_close_statement(
|
||||
const prepared_statement& stmt,
|
||||
const statement_base& stmt,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
);
|
||||
@@ -755,7 +755,7 @@ public:
|
||||
* \brief Reads a single row (sync with error code version).
|
||||
* \details Returns `true` if a row was read successfully, `false` if
|
||||
* there was an error or there were no more rows to read. Calling
|
||||
* this function on a complete resultset always returns `false`.
|
||||
* this function on a complete resultset_base always returns `false`.
|
||||
*
|
||||
* If the operation succeeds and returns `true`, the new row will be
|
||||
* read against `output`, possibly reusing its memory. If the operation
|
||||
@@ -763,13 +763,13 @@ public:
|
||||
* (as if [refmem row clear] was called). If the operation fails,
|
||||
* `output` is left in a valid but undetrmined state.
|
||||
*/
|
||||
bool read_one_row(resultset& resultset, row_view& output, error_code& err, error_info& info);
|
||||
bool read_one_row(resultset_base& resultset_base, row_view& output, error_code& err, error_info& info);
|
||||
|
||||
/**
|
||||
* \brief Reads a single row (sync with exceptions version).
|
||||
* \details Returns `true` if a row was read successfully, `false` if
|
||||
* there was an error or there were no more rows to read. Calling
|
||||
* this function on a complete resultset always returns `false`.
|
||||
* this function on a complete resultset_base always returns `false`.
|
||||
*
|
||||
* If the operation succeeds and returns `true`, the new row will be
|
||||
* read against `output`, possibly reusing its memory. If the operation
|
||||
@@ -777,13 +777,13 @@ public:
|
||||
* (as if [refmem row clear] was called). If the operation fails,
|
||||
* `output` is left in a valid but undetrmined state.
|
||||
*/
|
||||
bool read_one_row(resultset& resultset, row_view& output);
|
||||
bool read_one_row(resultset_base& resultset_base, row_view& output);
|
||||
|
||||
/**
|
||||
* \brief Reads a single row (async without [reflink error_info] version).
|
||||
* \details Completes with `true` if a row was read successfully, and with `false` if
|
||||
* there was an error or there were no more rows to read. Calling
|
||||
* this function on a complete resultset always returns `false`.
|
||||
* this function on a complete resultset_base always returns `false`.
|
||||
*
|
||||
* If the operation succeeds and completes with `true`, the new row will be
|
||||
* read against `output`, possibly reusing its memory. If the operation
|
||||
@@ -801,19 +801,19 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code, bool))
|
||||
async_read_one_row(
|
||||
resultset& resultset,
|
||||
resultset_base& resultset_base,
|
||||
row_view& output,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
)
|
||||
{
|
||||
return async_read_one_row(resultset, output, shared_info(), std::forward<CompletionToken>(token));
|
||||
return async_read_one_row(resultset_base, output, shared_info(), std::forward<CompletionToken>(token));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Reads a single row (async with [reflink error_info] version).
|
||||
* \details Completes with `true` if a row was read successfully, and with `false` if
|
||||
* there was an error or there were no more rows to read. Calling
|
||||
* this function on a complete resultset always returns `false`.
|
||||
* this function on a complete resultset_base always returns `false`.
|
||||
*
|
||||
* If the operation succeeds and completes with `true`, the new row will be
|
||||
* read against `output`, possibly reusing its memory. If the operation
|
||||
@@ -831,14 +831,14 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code, bool))
|
||||
async_read_one_row(
|
||||
resultset& resultset,
|
||||
resultset_base& resultset_base,
|
||||
row_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
);
|
||||
|
||||
void read_some_rows(resultset& resultset, rows_view& output, error_code& err, error_info& info);
|
||||
void read_some_rows(resultset& resultset, rows_view& output);
|
||||
void read_some_rows(resultset_base& resultset_base, rows_view& output, error_code& err, error_info& info);
|
||||
void read_some_rows(resultset_base& resultset_base, rows_view& output);
|
||||
|
||||
/**
|
||||
* \brief Reads several rows, up to a maximum
|
||||
@@ -854,12 +854,12 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_read_some_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& resultset_base,
|
||||
rows_view& output,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
)
|
||||
{
|
||||
return async_read_some_rows(resultset, output, shared_info(), std::forward<CompletionToken>(token));
|
||||
return async_read_some_rows(resultset_base, output, shared_info(), std::forward<CompletionToken>(token));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -876,17 +876,17 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_read_some_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& resultset_base,
|
||||
rows_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
);
|
||||
|
||||
/// Reads all available rows (sync with error code version).
|
||||
void read_all_rows(resultset& resultset, rows_view& output, error_code& err, error_info& info);
|
||||
void read_all_rows(resultset_base& resultset_base, rows_view& output, error_code& err, error_info& info);
|
||||
|
||||
/// Reads all available rows (sync with exceptions version).
|
||||
void read_all_rows(resultset& resultset, rows_view& output);
|
||||
void read_all_rows(resultset_base& resultset_base, rows_view& output);
|
||||
|
||||
/**
|
||||
* \brief Reads all available rows (async without [reflink error_info] version).
|
||||
@@ -901,12 +901,12 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_read_all_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& resultset_base,
|
||||
rows_view& output,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
)
|
||||
{
|
||||
return async_read_all_rows(resultset, output, shared_info(), std::forward<CompletionToken>(token));
|
||||
return async_read_all_rows(resultset_base, output, shared_info(), std::forward<CompletionToken>(token));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -922,7 +922,7 @@ public:
|
||||
>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_read_all_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& resultset_base,
|
||||
rows_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_GENERIC_HPP
|
||||
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/detail/channel/channel.hpp>
|
||||
#include <boost/mysql/detail/protocol/resultset_encoding.hpp>
|
||||
|
||||
@@ -23,7 +23,7 @@ void execute_generic(
|
||||
resultset_encoding encoding,
|
||||
channel<Stream>& channel,
|
||||
const Serializable& request,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
);
|
||||
@@ -34,7 +34,7 @@ async_execute_generic(
|
||||
resultset_encoding encoding,
|
||||
channel<Stream>& chan,
|
||||
const Serializable& request,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_info& info,
|
||||
CompletionToken&& token
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP
|
||||
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/detail/channel/channel.hpp>
|
||||
#include <boost/utility/string_view.hpp>
|
||||
|
||||
@@ -22,7 +22,7 @@ template <class Stream>
|
||||
void execute_query(
|
||||
channel<Stream>& channel,
|
||||
boost::string_view query,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
);
|
||||
@@ -32,7 +32,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_execute_query(
|
||||
channel<Stream>& chan,
|
||||
boost::string_view query,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_info& info,
|
||||
CompletionToken&& token
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP
|
||||
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/execute_params.hpp>
|
||||
#include <boost/mysql/detail/channel/channel.hpp>
|
||||
|
||||
@@ -21,7 +21,7 @@ template <class Stream, class FieldViewFwdIterator>
|
||||
void execute_statement(
|
||||
channel<Stream>& channel,
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
);
|
||||
@@ -31,7 +31,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_execute_statement(
|
||||
channel<Stream>& chan,
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_info& info,
|
||||
CompletionToken&& token
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <boost/mysql/detail/protocol/common_messages.hpp>
|
||||
#include <boost/mysql/detail/protocol/resultset_encoding.hpp>
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
@@ -28,7 +28,7 @@ namespace detail {
|
||||
|
||||
class execute_processor
|
||||
{
|
||||
resultset& output_;
|
||||
resultset_base& output_;
|
||||
error_info& output_info_;
|
||||
bytestring& write_buffer_;
|
||||
capabilities caps_;
|
||||
@@ -36,7 +36,7 @@ class execute_processor
|
||||
std::size_t remaining_fields_ {};
|
||||
public:
|
||||
execute_processor(
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_info& output_info,
|
||||
bytestring& write_buffer,
|
||||
capabilities caps
|
||||
@@ -224,7 +224,7 @@ void boost::mysql::detail::execute_generic(
|
||||
resultset_encoding encoding,
|
||||
channel<Stream>& channel,
|
||||
const Serializable& request,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
@@ -285,7 +285,7 @@ boost::mysql::detail::async_execute_generic(
|
||||
resultset_encoding encoding,
|
||||
channel<Stream>& channel,
|
||||
const Serializable& request,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_info& info,
|
||||
CompletionToken&& token
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ template <class Stream>
|
||||
void boost::mysql::detail::execute_query(
|
||||
channel<Stream>& channel,
|
||||
boost::string_view query,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
@@ -44,7 +44,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
boost::mysql::detail::async_execute_query(
|
||||
channel<Stream>& chan,
|
||||
boost::string_view query,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_info& info,
|
||||
CompletionToken&& token
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/execute_params.hpp>
|
||||
#include <boost/mysql/detail/network_algorithms/execute_statement.hpp>
|
||||
#include <boost/mysql/detail/protocol/prepared_statement_messages.hpp>
|
||||
@@ -45,7 +45,7 @@ template <class Stream, class FieldViewFwdIterator>
|
||||
void boost::mysql::detail::execute_statement(
|
||||
channel<Stream>& chan,
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
@@ -68,7 +68,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
boost::mysql::detail::async_execute_statement(
|
||||
channel<Stream>& chan,
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& output,
|
||||
resultset_base& output,
|
||||
error_info& info,
|
||||
CompletionToken&& token
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <boost/mysql/detail/channel/channel.hpp>
|
||||
#include <boost/mysql/detail/protocol/capabilities.hpp>
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/mysql/statement_base.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
@@ -28,14 +28,14 @@ class prepare_statement_processor
|
||||
{
|
||||
capabilities caps_;
|
||||
bytestring& write_buffer_;
|
||||
prepared_statement& output_;
|
||||
statement_base& output_;
|
||||
error_info& output_info_;
|
||||
unsigned remaining_meta_ {};
|
||||
public:
|
||||
template <class Stream>
|
||||
prepare_statement_processor(
|
||||
channel<Stream>& chan,
|
||||
prepared_statement& output,
|
||||
statement_base& output,
|
||||
error_info& output_info
|
||||
) noexcept :
|
||||
caps_(chan.current_capabilities()),
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
{
|
||||
com_stmt_prepare_ok_packet response;
|
||||
err = deserialize_message(ctx, response);
|
||||
output_ = prepared_statement(response);
|
||||
output_ = statement_base(response);
|
||||
remaining_meta_ = response.num_columns + response.num_params;
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ template <class Stream>
|
||||
void boost::mysql::detail::prepare_statement(
|
||||
channel<Stream>& channel,
|
||||
boost::string_view statement,
|
||||
prepared_statement& output,
|
||||
statement_base& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
@@ -210,7 +210,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
boost::mysql::detail::async_prepare_statement(
|
||||
channel<Stream>& chan,
|
||||
boost::string_view statement,
|
||||
prepared_statement& output,
|
||||
statement_base& output,
|
||||
error_info& info,
|
||||
CompletionToken&& token
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <boost/mysql/detail/protocol/deserialize_row.hpp>
|
||||
#include <boost/mysql/rows_view.hpp>
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/asio/post.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <boost/asio/coroutine.hpp>
|
||||
@@ -28,7 +28,7 @@ namespace detail {
|
||||
template <class Stream>
|
||||
inline void process_all_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
@@ -39,7 +39,7 @@ inline void process_all_rows(
|
||||
while (channel.has_read_messages())
|
||||
{
|
||||
// Get the row message
|
||||
auto message = channel.next_read_message(resultset.sequence_number(), err);
|
||||
auto message = channel.next_read_message(result.sequence_number(), err);
|
||||
if (err)
|
||||
return;
|
||||
|
||||
@@ -48,7 +48,7 @@ inline void process_all_rows(
|
||||
message,
|
||||
channel.current_capabilities(),
|
||||
channel.buffer_first(),
|
||||
resultset,
|
||||
result,
|
||||
channel.shared_fields(),
|
||||
err,
|
||||
info
|
||||
@@ -62,7 +62,7 @@ inline void process_all_rows(
|
||||
output = rows_view(
|
||||
channel.shared_fields().data(),
|
||||
channel.shared_fields().size(),
|
||||
resultset.meta().size()
|
||||
result.meta().size()
|
||||
);
|
||||
offsets_to_string_views(channel.shared_fields(), channel.buffer_first());
|
||||
break;
|
||||
@@ -76,18 +76,18 @@ struct read_all_rows_op : boost::asio::coroutine
|
||||
{
|
||||
channel<Stream>& chan_;
|
||||
error_info& output_info_;
|
||||
resultset& resultset_;
|
||||
resultset_base& resultset_;
|
||||
rows_view& output_;
|
||||
|
||||
read_all_rows_op(
|
||||
channel<Stream>& chan,
|
||||
error_info& output_info,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output
|
||||
) noexcept :
|
||||
chan_(chan),
|
||||
output_info_(output_info),
|
||||
resultset_(resultset),
|
||||
resultset_(result),
|
||||
output_(output)
|
||||
{
|
||||
}
|
||||
@@ -108,7 +108,7 @@ struct read_all_rows_op : boost::asio::coroutine
|
||||
// Normal path
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
// If the resultset is already complete, we don't need to read anything
|
||||
// If the resultset_base is already complete, we don't need to read anything
|
||||
if (resultset_.complete())
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD boost::asio::post(std::move(self));
|
||||
@@ -146,20 +146,20 @@ struct read_all_rows_op : boost::asio::coroutine
|
||||
template <class Stream>
|
||||
void boost::mysql::detail::read_all_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
{
|
||||
// If the resultset is already complete, we don't need to read anything
|
||||
if (resultset.complete())
|
||||
// If the resultset_base is already complete, we don't need to read anything
|
||||
if (result.complete())
|
||||
{
|
||||
output = rows_view();
|
||||
return;
|
||||
}
|
||||
|
||||
while (!resultset.complete())
|
||||
while (!result.complete())
|
||||
{
|
||||
// Read from the stream until there is at least one message
|
||||
channel.read_some(err, true);
|
||||
@@ -167,7 +167,7 @@ void boost::mysql::detail::read_all_rows(
|
||||
return;
|
||||
|
||||
// Process read messages
|
||||
process_all_rows(channel, resultset, output, err, info);
|
||||
process_all_rows(channel, result, output, err, info);
|
||||
if (err)
|
||||
return;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
)
|
||||
boost::mysql::detail::async_read_all_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
@@ -190,7 +190,7 @@ boost::mysql::detail::async_read_all_rows(
|
||||
read_all_rows_op<Stream>(
|
||||
channel,
|
||||
output_info,
|
||||
resultset,
|
||||
result,
|
||||
output
|
||||
),
|
||||
token,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <boost/mysql/detail/network_algorithms/read_one_row.hpp>
|
||||
#include <boost/mysql/detail/protocol/deserialize_row.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/row_view.hpp>
|
||||
#include <boost/asio/post.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
@@ -26,7 +26,7 @@ template <class Stream>
|
||||
inline bool process_one_row(
|
||||
boost::asio::const_buffer read_message,
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
row_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
@@ -40,7 +40,7 @@ inline bool process_one_row(
|
||||
read_message,
|
||||
channel.current_capabilities(),
|
||||
channel.buffer_first(),
|
||||
resultset,
|
||||
result,
|
||||
channel.shared_fields(),
|
||||
err,
|
||||
info
|
||||
@@ -65,18 +65,18 @@ struct read_one_row_op : boost::asio::coroutine
|
||||
{
|
||||
channel<Stream>& chan_;
|
||||
error_info& output_info_;
|
||||
resultset& resultset_;
|
||||
resultset_base& resultset_;
|
||||
row& output_;
|
||||
|
||||
read_one_row_op(
|
||||
channel<Stream>& chan,
|
||||
error_info& output_info,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
row& output
|
||||
) noexcept :
|
||||
chan_(chan),
|
||||
output_info_(output_info),
|
||||
resultset_(resultset),
|
||||
resultset_(result),
|
||||
output_(output)
|
||||
{
|
||||
}
|
||||
@@ -133,28 +133,28 @@ struct read_one_row_op : boost::asio::coroutine
|
||||
template <class Stream>
|
||||
bool boost::mysql::detail::read_one_row(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
row_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
{
|
||||
// If the resultset is already complete, we don't need to read anything
|
||||
if (resultset.complete())
|
||||
if (result.complete())
|
||||
{
|
||||
output = row_view();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read a packet
|
||||
auto read_message = channel.read_one(resultset.sequence_number(), err);
|
||||
auto read_message = channel.read_one(result.sequence_number(), err);
|
||||
if (err)
|
||||
return false;
|
||||
|
||||
return process_one_row(
|
||||
read_message,
|
||||
channel.current_capabilities(),
|
||||
resultset,
|
||||
result,
|
||||
output,
|
||||
err,
|
||||
info
|
||||
@@ -168,7 +168,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
)
|
||||
boost::mysql::detail::async_read_one_row(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
row_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
@@ -178,7 +178,7 @@ boost::mysql::detail::async_read_one_row(
|
||||
read_one_row_op<Stream>(
|
||||
channel,
|
||||
output_info,
|
||||
resultset,
|
||||
result,
|
||||
output
|
||||
),
|
||||
token,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <boost/mysql/detail/protocol/deserialize_row.hpp>
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/row.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/asio/post.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <cstddef>
|
||||
@@ -27,7 +27,7 @@ namespace detail {
|
||||
template <class Stream>
|
||||
inline void process_some_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
@@ -40,7 +40,7 @@ inline void process_some_rows(
|
||||
while (channel.has_read_messages())
|
||||
{
|
||||
// Get the row message
|
||||
auto message = channel.next_read_message(resultset.sequence_number(), err);
|
||||
auto message = channel.next_read_message(result.sequence_number(), err);
|
||||
if (err)
|
||||
return;
|
||||
|
||||
@@ -49,7 +49,7 @@ inline void process_some_rows(
|
||||
message,
|
||||
channel.current_capabilities(),
|
||||
channel.buffer_first(),
|
||||
resultset,
|
||||
result,
|
||||
channel.shared_fields(),
|
||||
err,
|
||||
info
|
||||
@@ -69,8 +69,8 @@ inline void process_some_rows(
|
||||
|
||||
output = rows_view(
|
||||
channel.shared_fields().data(),
|
||||
num_rows * resultset.fields().size(),
|
||||
resultset.fields().size()
|
||||
num_rows * result.fields().size(),
|
||||
result.fields().size()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -80,18 +80,18 @@ struct read_some_rows_op : boost::asio::coroutine
|
||||
{
|
||||
channel<Stream>& chan_;
|
||||
error_info& output_info_;
|
||||
resultset& resultset_;
|
||||
resultset_base& resultset_;
|
||||
rows_view& output_;
|
||||
|
||||
read_some_rows_op(
|
||||
channel<Stream>& chan,
|
||||
error_info& output_info,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output
|
||||
) noexcept :
|
||||
chan_(chan),
|
||||
output_info_(output_info),
|
||||
resultset_(resultset),
|
||||
resultset_(result),
|
||||
output_(output)
|
||||
{
|
||||
}
|
||||
@@ -140,14 +140,14 @@ struct read_some_rows_op : boost::asio::coroutine
|
||||
template <class Stream>
|
||||
void boost::mysql::detail::read_some_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
{
|
||||
// If the resultset is already complete, we don't need to read anything
|
||||
if (resultset.complete())
|
||||
if (result.complete())
|
||||
{
|
||||
output = rows_view();
|
||||
return;
|
||||
@@ -159,7 +159,7 @@ void boost::mysql::detail::read_some_rows(
|
||||
return;
|
||||
|
||||
// Process read messages
|
||||
process_some_rows(channel, resultset, output, err, info);
|
||||
process_some_rows(channel, result, output, err, info);
|
||||
}
|
||||
|
||||
template <class Stream, class CompletionToken>
|
||||
@@ -169,7 +169,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
)
|
||||
boost::mysql::detail::async_read_some_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
@@ -179,7 +179,7 @@ boost::mysql::detail::async_read_some_rows(
|
||||
read_some_rows_op<Stream>(
|
||||
channel,
|
||||
output_info,
|
||||
resultset,
|
||||
result,
|
||||
output
|
||||
),
|
||||
token,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP
|
||||
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/mysql/statement_base.hpp>
|
||||
#include <boost/utility/string_view.hpp>
|
||||
#include <boost/mysql/detail/channel/channel.hpp>
|
||||
|
||||
@@ -22,7 +22,7 @@ template <class Stream>
|
||||
void prepare_statement(
|
||||
channel<Stream>& chan,
|
||||
boost::string_view statement,
|
||||
prepared_statement& output,
|
||||
statement_base& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
);
|
||||
@@ -32,7 +32,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_prepare_statement(
|
||||
channel<Stream>& chan,
|
||||
boost::string_view statement,
|
||||
prepared_statement& output,
|
||||
statement_base& output,
|
||||
error_info& info,
|
||||
CompletionToken&& token
|
||||
);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/detail/channel/channel.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/rows_view.hpp>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace detail {
|
||||
template <class Stream>
|
||||
void read_all_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
@@ -31,7 +31,7 @@ template <class Stream, class CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_read_all_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/detail/channel/channel.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/row.hpp>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace detail {
|
||||
template <class Stream>
|
||||
bool read_one_row(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
row_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
@@ -31,7 +31,7 @@ template <class Stream, class CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code, bool))
|
||||
async_read_one_row(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
row_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/detail/channel/channel.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/rows_view.hpp>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace detail {
|
||||
template <class Stream>
|
||||
void read_some_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
@@ -31,7 +31,7 @@ template <class Stream, class CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
|
||||
async_read_some_rows(
|
||||
channel<Stream>& channel,
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <boost/mysql/detail/protocol/serialization.hpp>
|
||||
#include <boost/mysql/detail/protocol/text_deserialization.hpp>
|
||||
#include <boost/mysql/detail/protocol/binary_deserialization.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/field_view.hpp>
|
||||
#include <vector>
|
||||
@@ -28,13 +28,13 @@ inline bool deserialize_row(
|
||||
boost::asio::const_buffer read_message,
|
||||
capabilities current_capabilities,
|
||||
const std::uint8_t* buffer_first, // to store strings as offsets and allow buffer reallocation
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
std::vector<field_view>& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
{
|
||||
assert(resultset.valid());
|
||||
assert(result.valid());
|
||||
|
||||
// Message type: row, error or eof?
|
||||
std::uint8_t msg_type = 0;
|
||||
@@ -49,7 +49,7 @@ inline bool deserialize_row(
|
||||
err = deserialize_message(ctx, ok_pack);
|
||||
if (err)
|
||||
return false;
|
||||
resultset.complete(ok_pack);
|
||||
result.complete(ok_pack);
|
||||
output.clear();
|
||||
return false;
|
||||
}
|
||||
@@ -63,9 +63,9 @@ inline bool deserialize_row(
|
||||
{
|
||||
// An actual row
|
||||
ctx.rewind(1); // keep the 'message type' byte, as it is part of the actual message
|
||||
err = resultset.encoding() == detail::resultset_encoding::text ?
|
||||
deserialize_text_row(ctx, resultset.meta(), buffer_first, output) :
|
||||
deserialize_binary_row(ctx, resultset.meta(), buffer_first, output);
|
||||
err = result.encoding() == detail::resultset_encoding::text ?
|
||||
deserialize_text_row(ctx, result.meta(), buffer_first, output) :
|
||||
deserialize_binary_row(ctx, result.meta(), buffer_first, output);
|
||||
if (err)
|
||||
return false;
|
||||
return true;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef BOOST_MYSQL_EXECUTE_PARAMS_HPP
|
||||
#define BOOST_MYSQL_EXECUTE_PARAMS_HPP
|
||||
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/mysql/statement_base.hpp>
|
||||
#include <boost/mysql/detail/auxiliar/field_type_traits.hpp>
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
@@ -17,10 +17,10 @@ namespace boost {
|
||||
namespace mysql {
|
||||
|
||||
/**
|
||||
* \brief Represents the parameters required to execute a [reflink prepared_statement].
|
||||
* \brief Represents the parameters required to execute a [reflink statement_base].
|
||||
* \details In essence, this class contains an iterator range \\[first, last), pointing
|
||||
* to a sequence of [reflink value]s that will be used as parameters to execute a
|
||||
* [reflink prepared_statement]. FieldViewFwdIterator must meet the [reflink FieldViewFwdIterator]
|
||||
* [reflink statement_base]. FieldViewFwdIterator must meet the [reflink FieldViewFwdIterator]
|
||||
* type requirements.
|
||||
*
|
||||
* In the future, this class may define extra members providing finer control
|
||||
@@ -40,7 +40,7 @@ class execute_params
|
||||
public:
|
||||
/// Constructor.
|
||||
execute_params(
|
||||
const prepared_statement& stmt,
|
||||
const statement_base& stmt,
|
||||
FieldViewFwdIterator first,
|
||||
FieldViewFwdIterator last
|
||||
);
|
||||
@@ -60,7 +60,7 @@ template <
|
||||
>
|
||||
constexpr execute_params<FieldViewFwdIterator>
|
||||
make_execute_params(
|
||||
const prepared_statement& stmt,
|
||||
const statement_base& stmt,
|
||||
FieldViewFwdIterator first,
|
||||
FieldViewFwdIterator last
|
||||
)
|
||||
@@ -73,7 +73,7 @@ template <
|
||||
class EnableIf = detail::enable_if_field_view_collection<FieldViewCollection>
|
||||
>
|
||||
constexpr auto make_execute_params(
|
||||
const prepared_statement& stmt,
|
||||
const statement_base& stmt,
|
||||
const FieldViewCollection& col
|
||||
) -> execute_params<decltype(std::begin(col))>
|
||||
{
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
#include <boost/mysql/row.hpp>
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/statement_base.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/detail/network_algorithms/connect.hpp>
|
||||
#include <boost/mysql/detail/network_algorithms/handshake.hpp>
|
||||
#include <boost/mysql/detail/network_algorithms/execute_query.hpp>
|
||||
@@ -129,7 +129,7 @@ boost::mysql::connection<Stream>::async_handshake(
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::query(
|
||||
boost::string_view query_string,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
@@ -141,7 +141,7 @@ void boost::mysql::connection<Stream>::query(
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::query(
|
||||
boost::string_view query_string,
|
||||
resultset& result
|
||||
resultset_base& result
|
||||
)
|
||||
{
|
||||
detail::error_block blk;
|
||||
@@ -159,7 +159,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
)
|
||||
boost::mysql::connection<Stream>::async_query(
|
||||
boost::string_view query_string,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
)
|
||||
@@ -179,7 +179,7 @@ boost::mysql::connection<Stream>::async_query(
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::prepare_statement(
|
||||
boost::string_view statement,
|
||||
prepared_statement& output,
|
||||
statement_base& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
@@ -191,7 +191,7 @@ void boost::mysql::connection<Stream>::prepare_statement(
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::prepare_statement(
|
||||
boost::string_view statement,
|
||||
prepared_statement& output
|
||||
statement_base& output
|
||||
)
|
||||
{
|
||||
detail::error_block blk;
|
||||
@@ -209,7 +209,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
)
|
||||
boost::mysql::connection<Stream>::async_prepare_statement(
|
||||
boost::string_view statement,
|
||||
prepared_statement& output,
|
||||
statement_base& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
)
|
||||
@@ -230,7 +230,7 @@ template <class Stream>
|
||||
template <class FieldViewFwdIterator>
|
||||
void boost::mysql::connection<Stream>::execute_statement(
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
@@ -249,7 +249,7 @@ template <class Stream>
|
||||
template <class FieldViewFwdIterator>
|
||||
void boost::mysql::connection<Stream>::execute_statement(
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& result
|
||||
resultset_base& result
|
||||
)
|
||||
{
|
||||
detail::error_block blk;
|
||||
@@ -274,7 +274,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
)
|
||||
boost::mysql::connection<Stream>::async_execute_statement(
|
||||
const execute_params<FieldViewFwdIterator>& params,
|
||||
resultset& result,
|
||||
resultset_base& result,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
)
|
||||
@@ -292,7 +292,7 @@ boost::mysql::connection<Stream>::async_execute_statement(
|
||||
// Close statement
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::close_statement(
|
||||
const prepared_statement& stmt,
|
||||
const statement_base& stmt,
|
||||
error_code& code,
|
||||
error_info& info
|
||||
)
|
||||
@@ -303,7 +303,7 @@ void boost::mysql::connection<Stream>::close_statement(
|
||||
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::close_statement(
|
||||
const prepared_statement& stmt
|
||||
const statement_base& stmt
|
||||
)
|
||||
{
|
||||
detail::error_block blk;
|
||||
@@ -321,7 +321,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
void(boost::mysql::error_code)
|
||||
)
|
||||
boost::mysql::connection<Stream>::async_close_statement(
|
||||
const prepared_statement& stmt,
|
||||
const statement_base& stmt,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
)
|
||||
@@ -338,25 +338,25 @@ boost::mysql::connection<Stream>::async_close_statement(
|
||||
// Read one row
|
||||
template <class Stream>
|
||||
bool boost::mysql::connection<Stream>::read_one_row(
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
row_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
{
|
||||
detail::clear_errors(err, info);
|
||||
detail::read_one_row(get_channel(), resultset, output, err, info);
|
||||
detail::read_one_row(get_channel(), result, output, err, info);
|
||||
}
|
||||
|
||||
|
||||
template <class Stream>
|
||||
bool boost::mysql::connection<Stream>::read_one_row(
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
row_view& output
|
||||
)
|
||||
{
|
||||
detail::error_block blk;
|
||||
bool res = detail::read_one_row(get_channel(), resultset, output, blk.err, blk.info);
|
||||
bool res = detail::read_one_row(get_channel(), result, output, blk.err, blk.info);
|
||||
blk.check();
|
||||
return res;
|
||||
}
|
||||
@@ -370,7 +370,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
void(boost::mysql::error_code, bool)
|
||||
)
|
||||
boost::mysql::connection<Stream>::async_read_one_row(
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
row_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
@@ -379,7 +379,7 @@ boost::mysql::connection<Stream>::async_read_one_row(
|
||||
output_info.clear();
|
||||
return detail::async_read_one_row(
|
||||
get_channel(),
|
||||
resultset,
|
||||
result,
|
||||
output,
|
||||
output_info,
|
||||
std::forward<CompletionToken>(token)
|
||||
@@ -389,25 +389,25 @@ boost::mysql::connection<Stream>::async_read_one_row(
|
||||
// Read some rows
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::read_some_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
{
|
||||
detail::clear_errors(err, info);
|
||||
detail::read_some_rows(get_channel(), resultset, output, err, info);
|
||||
detail::read_some_rows(get_channel(), result, output, err, info);
|
||||
}
|
||||
|
||||
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::read_some_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output
|
||||
)
|
||||
{
|
||||
detail::error_block blk;
|
||||
detail::read_some_rows(get_channel(), resultset, output, blk.err, blk.info);
|
||||
detail::read_some_rows(get_channel(), result, output, blk.err, blk.info);
|
||||
blk.check();
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
void(boost::mysql::error_code)
|
||||
)
|
||||
boost::mysql::connection<Stream>::async_read_some_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
@@ -429,7 +429,7 @@ boost::mysql::connection<Stream>::async_read_some_rows(
|
||||
output_info.clear();
|
||||
return detail::async_read_some_rows(
|
||||
get_channel(),
|
||||
resultset,
|
||||
result,
|
||||
output,
|
||||
output_info,
|
||||
std::forward<CompletionToken>(token)
|
||||
@@ -439,25 +439,25 @@ boost::mysql::connection<Stream>::async_read_some_rows(
|
||||
// Read all rows
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::read_all_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_code& err,
|
||||
error_info& info
|
||||
)
|
||||
{
|
||||
detail::clear_errors(err, info);
|
||||
detail::read_all_rows(get_channel(), resultset, output, err, info);
|
||||
detail::read_all_rows(get_channel(), result, output, err, info);
|
||||
}
|
||||
|
||||
|
||||
template <class Stream>
|
||||
void boost::mysql::connection<Stream>::read_all_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output
|
||||
)
|
||||
{
|
||||
detail::error_block blk;
|
||||
detail::read_all_rows(get_channel(), resultset, output, blk.err, blk.info);
|
||||
detail::read_all_rows(get_channel(), result, output, blk.err, blk.info);
|
||||
blk.check();
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
void(boost::mysql::error_code)
|
||||
)
|
||||
boost::mysql::connection<Stream>::async_read_all_rows(
|
||||
resultset& resultset,
|
||||
resultset_base& result,
|
||||
rows_view& output,
|
||||
error_info& output_info,
|
||||
CompletionToken&& token
|
||||
@@ -479,7 +479,7 @@ boost::mysql::connection<Stream>::async_read_all_rows(
|
||||
output_info.clear();
|
||||
return detail::async_read_all_rows(
|
||||
get_channel(),
|
||||
resultset,
|
||||
result,
|
||||
output,
|
||||
output_info,
|
||||
std::forward<CompletionToken>(token)
|
||||
|
||||
@@ -22,7 +22,7 @@ template <class FieldViewFwdIterator>
|
||||
void check_num_params(
|
||||
FieldViewFwdIterator first,
|
||||
FieldViewFwdIterator last,
|
||||
const prepared_statement& stmt
|
||||
const statement_base& stmt
|
||||
)
|
||||
{
|
||||
auto param_count = std::distance(first, last);
|
||||
@@ -39,7 +39,7 @@ void check_num_params(
|
||||
|
||||
template <class FieldViewFwdIterator>
|
||||
boost::mysql::execute_params<FieldViewFwdIterator>::execute_params(
|
||||
const prepared_statement& stmt,
|
||||
const statement_base& stmt,
|
||||
FieldViewFwdIterator first,
|
||||
FieldViewFwdIterator last
|
||||
) :
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace mysql {
|
||||
* \brief Holds [link mysql.resultsets.metadata metadata] about a field in a SQL query.
|
||||
* \details All strings point into externally owned memory. The object
|
||||
* will be valid while the parent object is alive
|
||||
* (typically, a [reflink resultset] object).
|
||||
* (typically, a [reflink resultset_base] object).
|
||||
*/
|
||||
class metadata
|
||||
{
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef BOOST_MYSQL_RESULTSET_HPP
|
||||
#define BOOST_MYSQL_RESULTSET_HPP
|
||||
#ifndef BOOST_MYSQL_RESULTSET_BASE_HPP
|
||||
#define BOOST_MYSQL_RESULTSET_BASE_HPP
|
||||
|
||||
#include <boost/mysql/error.hpp>
|
||||
#include <boost/mysql/row.hpp>
|
||||
@@ -34,11 +34,11 @@ namespace mysql {
|
||||
* provides an in-depth explanation of the mechanics of this class.
|
||||
*
|
||||
* Resultsets are default-constructible and movable, but not copyable.
|
||||
* [refmem resultset valid] returns `false` for default-constructed
|
||||
* [refmem resultset_base valid] returns `false` for default-constructed
|
||||
* and moved-from resultsets. Calling any member function on an invalid
|
||||
* resultset, other than assignment, results in undefined behavior.
|
||||
* resultset_base, other than assignment, results in undefined behavior.
|
||||
*/
|
||||
class resultset
|
||||
class resultset_base
|
||||
{
|
||||
class ok_packet_data
|
||||
{
|
||||
@@ -79,18 +79,18 @@ class resultset
|
||||
|
||||
public:
|
||||
/// \brief Default constructor.
|
||||
/// \details Default constructed resultsets have [refmem resultset valid] return `false`.
|
||||
resultset() = default;
|
||||
/// \details Default constructed resultsets have [refmem resultset_base valid] return `false`.
|
||||
resultset_base() = default;
|
||||
|
||||
#ifndef BOOST_MYSQL_DOXYGEN
|
||||
// Private, do not use. TODO: hide these
|
||||
resultset(std::vector<metadata>&& meta, detail::resultset_encoding encoding) noexcept:
|
||||
resultset_base(std::vector<metadata>&& meta, detail::resultset_encoding encoding) noexcept:
|
||||
valid_(true),
|
||||
encoding_(encoding),
|
||||
meta_(std::move(meta))
|
||||
{
|
||||
};
|
||||
resultset(const detail::ok_packet& ok_pack):
|
||||
resultset_base(const detail::ok_packet& ok_pack):
|
||||
valid_(true),
|
||||
ok_packet_(ok_pack)
|
||||
{
|
||||
@@ -132,14 +132,14 @@ public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Returns whether this object represents a valid resultset.
|
||||
* \brief Returns whether this object represents a valid resultset_base.
|
||||
* \details Returns `false` for default-constructed and moved-from resultsets.
|
||||
* Calling any member function on an invalid resultset,
|
||||
* Calling any member function on an invalid resultset_base,
|
||||
* other than assignment, results in undefined behavior.
|
||||
*/
|
||||
bool valid() const noexcept { return valid_; }
|
||||
|
||||
/// \brief Returns whether the resultset has been completely read or not.
|
||||
/// \brief Returns whether the resultset_base has been completely read or not.
|
||||
/// \details See [link mysql.resultsets.complete this section] for more info.
|
||||
bool complete() const noexcept { return ok_packet_.has_value(); }
|
||||
|
||||
@@ -151,32 +151,32 @@ public:
|
||||
metadata_collection_view meta() const noexcept { return metadata_collection_view(meta_.data(), meta_.size()); }
|
||||
|
||||
/**
|
||||
* \brief The number of rows affected by the SQL that generated this resultset.
|
||||
* \details The resultset __must be [link mysql.resultsets.complete complete]__
|
||||
* \brief The number of rows affected by the SQL that generated this resultset_base.
|
||||
* \details The resultset_base __must be [link mysql.resultsets.complete complete]__
|
||||
* before calling this function.
|
||||
*/
|
||||
std::uint64_t affected_rows() const noexcept { return ok_packet_.affected_rows(); }
|
||||
|
||||
/**
|
||||
* \brief The last insert ID produced by the SQL that generated this resultset.
|
||||
* \details The resultset __must be [link mysql.resultsets.complete complete]__
|
||||
* \brief The last insert ID produced by the SQL that generated this resultset_base.
|
||||
* \details The resultset_base __must be [link mysql.resultsets.complete complete]__
|
||||
* before calling this function.
|
||||
*/
|
||||
std::uint64_t last_insert_id() const noexcept { return ok_packet_.last_insert_id(); }
|
||||
|
||||
/**
|
||||
* \brief The number of warnings produced by the SQL that generated this resultset.
|
||||
* \details The resultset __must be [link mysql.resultsets.complete complete]__
|
||||
* \brief The number of warnings produced by the SQL that generated this resultset_base.
|
||||
* \details The resultset_base __must be [link mysql.resultsets.complete complete]__
|
||||
* before calling this function.
|
||||
*/
|
||||
unsigned warning_count() const noexcept { return ok_packet_.warning_count(); }
|
||||
|
||||
/**
|
||||
* \brief Additionat text information about the execution of
|
||||
* the SQL that generated this resultset.
|
||||
* \details The resultset __must be [link mysql.resultsets.complete complete]__
|
||||
* the SQL that generated this resultset_base.
|
||||
* \details The resultset_base __must be [link mysql.resultsets.complete complete]__
|
||||
* before calling this function. The returned string is guaranteed to be valid
|
||||
* until the resultset object is destroyed.
|
||||
* until the resultset_base object is destroyed.
|
||||
*/
|
||||
boost::string_view info() const noexcept { return ok_packet_.info(); }
|
||||
};
|
||||
@@ -30,7 +30,7 @@ namespace mysql {
|
||||
*
|
||||
* There will be the same number of values and in the same order as fields
|
||||
* in the SQL query that produced the row. You can get more information
|
||||
* about these fields using [refmem resultset fields].
|
||||
* about these fields using [refmem resultset_base fields].
|
||||
*
|
||||
* If any of the values is a string, it will be represented as a `string_view`
|
||||
* pointing into the row's buffer. These string values will be valid as long as
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef BOOST_MYSQL_PREPARED_STATEMENT_HPP
|
||||
#define BOOST_MYSQL_PREPARED_STATEMENT_HPP
|
||||
#ifndef BOOST_MYSQL_STATEMENT_BASE_HPP
|
||||
#define BOOST_MYSQL_STATEMENT_BASE_HPP
|
||||
|
||||
|
||||
#include <boost/mysql/detail/protocol/prepared_statement_messages.hpp>
|
||||
@@ -25,34 +25,34 @@ constexpr std::array<field_view, 0> no_statement_params {};
|
||||
* \details This class is a handle to a server-side prepared statement.
|
||||
*
|
||||
* The main use of a prepared statement is executing it
|
||||
* using [refmem prepared_statement execute], which yields a [reflink resultset].
|
||||
* using [refmem statement_base execute], which yields a [reflink resultset_base].
|
||||
*
|
||||
* Prepared statements are default-constructible and movable, but not copyable.
|
||||
* [refmem prepared_statement valid] returns `false` for default-constructed
|
||||
* [refmem statement_base valid] returns `false` for default-constructed
|
||||
* and moved-from prepared statements. Calling any member function on an invalid
|
||||
* prepared statements, other than assignment, results in undefined behavior.
|
||||
*
|
||||
* Prepared statements are managed by the server in a per-connection basis:
|
||||
* once created, a prepared statement may be used as long as the parent
|
||||
* [reflink connection] object (i.e. the connection that originated the resultset)
|
||||
* is alive and open. Calling any function on a prepared_statement
|
||||
* [reflink connection] object (i.e. the connection that originated the resultset_base)
|
||||
* is alive and open. Calling any function on a statement_base
|
||||
* whose parent connection has been closed or destroyed results
|
||||
* in undefined behavior.
|
||||
*/
|
||||
class prepared_statement
|
||||
class statement_base
|
||||
{
|
||||
bool valid_ {false};
|
||||
detail::com_stmt_prepare_ok_packet stmt_msg_;
|
||||
public:
|
||||
/**
|
||||
* \brief Default constructor.
|
||||
* \details Default constructed statements have [refmem prepared_statement valid] return `false`.
|
||||
* \details Default constructed statements have [refmem statement_base valid] return `false`.
|
||||
*/
|
||||
prepared_statement() = default;
|
||||
statement_base() = default;
|
||||
|
||||
#ifndef BOOST_MYSQL_DOXYGEN
|
||||
// Private. Do not use. TODO: hide this
|
||||
prepared_statement(const detail::com_stmt_prepare_ok_packet& msg) noexcept:
|
||||
statement_base(const detail::com_stmt_prepare_ok_packet& msg) noexcept:
|
||||
valid_(true), stmt_msg_(msg) {}
|
||||
#endif
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#define BOOST_MYSQL_TCP_HPP
|
||||
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#define BOOST_MYSQL_TCP_SSL_HPP
|
||||
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/asio/ssl/stream.hpp>
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#define BOOST_MYSQL_UNIX_HPP
|
||||
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/asio/local/stream_protocol.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#define BOOST_MYSQL_UNIX_SSL_HPP
|
||||
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/asio/local/stream_protocol.hpp>
|
||||
#include <boost/asio/ssl/stream.hpp>
|
||||
|
||||
|
||||
@@ -624,7 +624,7 @@ BOOST_DATA_TEST_CASE_F(tcp_network_fixture, query, data::make(all_samples))
|
||||
BOOST_TEST(rows[0].values()[0] == sample.expected_value);
|
||||
}
|
||||
|
||||
BOOST_DATA_TEST_CASE_F(tcp_network_fixture, prepared_statement, data::make(all_samples))
|
||||
BOOST_DATA_TEST_CASE_F(tcp_network_fixture, statement_base, data::make(all_samples))
|
||||
{
|
||||
connect();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/mysql/statement_base.hpp>
|
||||
#include "integration_test_common.hpp"
|
||||
#include "tcp_network_fixture.hpp"
|
||||
#include "streams.hpp"
|
||||
@@ -69,7 +69,7 @@ BOOST_FIXTURE_TEST_CASE(move_assignment_to_invalid, tcp_network_fixture)
|
||||
{
|
||||
connect();
|
||||
|
||||
// Get a valid resultset and perform a move assignment
|
||||
// Get a valid resultset_base and perform a move assignment
|
||||
tcp_prepared_statement s1 = conn.prepare_statement("SELECT * FROM empty_table");
|
||||
tcp_prepared_statement s2;
|
||||
s2 = std::move(s1);
|
||||
@@ -87,7 +87,7 @@ BOOST_FIXTURE_TEST_CASE(move_assignment_to_valid, tcp_network_fixture)
|
||||
{
|
||||
connect();
|
||||
|
||||
// Get a valid resultset and perform a move assignment
|
||||
// Get a valid resultset_base and perform a move assignment
|
||||
tcp_prepared_statement s1 = conn.prepare_statement("SELECT * FROM empty_table");
|
||||
tcp_prepared_statement s2 = conn.prepare_statement("SELECT * FROM empty_table WHERE id IN (?, ?)");
|
||||
s2 = std::move(s1);
|
||||
@@ -96,7 +96,7 @@ BOOST_FIXTURE_TEST_CASE(move_assignment_to_valid, tcp_network_fixture)
|
||||
BOOST_TEST(!s1.valid());
|
||||
BOOST_TEST(s2.valid());
|
||||
|
||||
// We can use the 2nd resultset
|
||||
// We can use the 2nd resultset_base
|
||||
auto rows = s2.execute(no_statement_params).read_all();
|
||||
BOOST_TEST(rows.empty());
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ BOOST_MYSQL_NETWORK_TEST(insert_ok, network_fixture)
|
||||
auto result = conn->query(
|
||||
"INSERT INTO inserts_table (field_varchar, field_date) VALUES ('v0', '2010-10-11')").get();
|
||||
|
||||
// Verify resultset
|
||||
// Verify resultset_base
|
||||
BOOST_TEST(result->fields().empty());
|
||||
BOOST_TEST(result->valid());
|
||||
BOOST_TEST(result->complete());
|
||||
@@ -54,7 +54,7 @@ BOOST_MYSQL_NETWORK_TEST(update_ok, network_fixture)
|
||||
// Issue the query
|
||||
auto result = conn->query("UPDATE updates_table SET field_int = field_int+10").get();
|
||||
|
||||
// Validate resultset
|
||||
// Validate resultset_base
|
||||
BOOST_TEST(result->fields().empty());
|
||||
BOOST_TEST(result->valid());
|
||||
BOOST_TEST(result->complete());
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/row.hpp>
|
||||
#include "er_connection.hpp"
|
||||
#include "er_resultset.hpp"
|
||||
@@ -62,7 +62,7 @@ void validate_eof(
|
||||
BOOST_TEST(result.info() == info);
|
||||
}
|
||||
|
||||
// Interface to generate a resultset
|
||||
// Interface to generate a resultset_base
|
||||
class resultset_generator
|
||||
{
|
||||
public:
|
||||
@@ -163,7 +163,7 @@ BOOST_MYSQL_NETWORK_TEST_EX(no_results, resultset_fixture, sample_gen())
|
||||
BOOST_TEST(!result->complete());
|
||||
BOOST_TEST(result->fields().size() == 2u);
|
||||
|
||||
// Already in the end of the resultset, we receive the EOF
|
||||
// Already in the end of the resultset_base, we receive the EOF
|
||||
row r = make_initial_row();
|
||||
bool has_row = result->read_one(r).get();
|
||||
BOOST_TEST(!has_row);
|
||||
@@ -194,7 +194,7 @@ BOOST_MYSQL_NETWORK_TEST_EX(one_row, resultset_fixture, sample_gen())
|
||||
BOOST_TEST((r == makerow(1, "f0")));
|
||||
BOOST_TEST(!result->complete());
|
||||
|
||||
// Read next: end of resultset
|
||||
// Read next: end of resultset_base
|
||||
r = make_initial_row();
|
||||
has_row = result->read_one(r).get();
|
||||
BOOST_TEST(!has_row);
|
||||
@@ -226,7 +226,7 @@ BOOST_MYSQL_NETWORK_TEST_EX(two_rows, resultset_fixture, sample_gen())
|
||||
BOOST_TEST((r == makerow(2, "f1")));
|
||||
BOOST_TEST(!result->complete());
|
||||
|
||||
// Read next: end of resultset
|
||||
// Read next: end of resultset_base
|
||||
r = make_initial_row();
|
||||
has_row = result->read_one(r).get();
|
||||
BOOST_TEST(!has_row);
|
||||
@@ -266,7 +266,7 @@ BOOST_MYSQL_NETWORK_TEST_EX(more_rows_than_count, resultset_fixture, sample_gen(
|
||||
BOOST_TEST(!result->complete());
|
||||
BOOST_TEST((rows == makerows(2, 1, "f0", 2, "f1")));
|
||||
|
||||
// Read another two (completes the resultset)
|
||||
// Read another two (completes the resultset_base)
|
||||
rows = result->read_many(2).get();
|
||||
validate_eof(*result);
|
||||
BOOST_TEST((rows == makerows(2, 3, "f2")));
|
||||
@@ -277,7 +277,7 @@ BOOST_MYSQL_NETWORK_TEST_EX(less_rows_than_count, resultset_fixture, sample_gen(
|
||||
setup_and_connect(sample);
|
||||
auto result = generate("SELECT * FROM two_rows_table");
|
||||
|
||||
// Read 3, resultset exhausted
|
||||
// Read 3, resultset_base exhausted
|
||||
auto rows = result->read_many(3).get();
|
||||
BOOST_TEST((rows == makerows(2, 1, "f0", 2, "f1")));
|
||||
validate_eof(*result);
|
||||
@@ -288,12 +288,12 @@ BOOST_MYSQL_NETWORK_TEST_EX(same_rows_as_count, resultset_fixture, sample_gen())
|
||||
setup_and_connect(sample);
|
||||
auto result = generate("SELECT * FROM two_rows_table");
|
||||
|
||||
// Read 2, 0 remaining but resultset not exhausted
|
||||
// Read 2, 0 remaining but resultset_base not exhausted
|
||||
auto rows = result->read_many(2).get();
|
||||
BOOST_TEST(!result->complete());
|
||||
BOOST_TEST((rows == makerows(2, 1, "f0", 2, "f1")));
|
||||
|
||||
// Read again, exhausts the resultset
|
||||
// Read again, exhausts the resultset_base
|
||||
rows = result->read_many(2).get();
|
||||
BOOST_TEST(rows.empty());
|
||||
validate_eof(*result);
|
||||
@@ -361,7 +361,7 @@ BOOST_FIXTURE_TEST_CASE(move_ctor, tcp_network_fixture)
|
||||
{
|
||||
connect();
|
||||
|
||||
// Get a valid resultset and perform a move construction
|
||||
// Get a valid resultset_base and perform a move construction
|
||||
tcp_resultset r = conn.query("SELECT * FROM one_row_table");
|
||||
tcp_resultset r2 (std::move(r));
|
||||
|
||||
@@ -369,7 +369,7 @@ BOOST_FIXTURE_TEST_CASE(move_ctor, tcp_network_fixture)
|
||||
BOOST_TEST(!r.valid());
|
||||
BOOST_TEST(r2.valid());
|
||||
|
||||
// We can use the 2nd resultset
|
||||
// We can use the 2nd resultset_base
|
||||
auto rows = r2.read_all();
|
||||
BOOST_TEST((rows == makerows(2, 1, "f0")));
|
||||
BOOST_TEST(r2.complete());
|
||||
@@ -379,7 +379,7 @@ BOOST_FIXTURE_TEST_CASE(move_assignment_to_invalid, tcp_network_fixture)
|
||||
{
|
||||
connect();
|
||||
|
||||
// Get a valid resultset and perform a move assignment
|
||||
// Get a valid resultset_base and perform a move assignment
|
||||
tcp_resultset r = conn.query("SELECT * FROM one_row_table");
|
||||
tcp_resultset r2;
|
||||
r2 = std::move(r);
|
||||
@@ -388,7 +388,7 @@ BOOST_FIXTURE_TEST_CASE(move_assignment_to_invalid, tcp_network_fixture)
|
||||
BOOST_TEST(!r.valid());
|
||||
BOOST_TEST(r2.valid());
|
||||
|
||||
// We can use the 2nd resultset
|
||||
// We can use the 2nd resultset_base
|
||||
auto rows = r2.read_all();
|
||||
BOOST_TEST((rows == makerows(2, 1, "f0")));
|
||||
BOOST_TEST(r2.complete());
|
||||
@@ -398,7 +398,7 @@ BOOST_FIXTURE_TEST_CASE(move_assignment_to_valid, tcp_network_fixture)
|
||||
{
|
||||
connect();
|
||||
|
||||
// Get a valid resultset and perform a move assignment
|
||||
// Get a valid resultset_base and perform a move assignment
|
||||
tcp_resultset r2 = conn.query("SELECT * FROM empty_table");
|
||||
r2.read_all(); // clean any remaining packets
|
||||
tcp_resultset r = conn.query("SELECT * FROM one_row_table");
|
||||
@@ -408,7 +408,7 @@ BOOST_FIXTURE_TEST_CASE(move_assignment_to_valid, tcp_network_fixture)
|
||||
BOOST_TEST(!r.valid());
|
||||
BOOST_TEST(r2.valid());
|
||||
|
||||
// We can use the 2nd resultset
|
||||
// We can use the 2nd resultset_base
|
||||
auto rows = r2.read_all();
|
||||
BOOST_TEST((rows == makerows(2, 1, "f0")));
|
||||
BOOST_TEST(r2.complete());
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include "boost/mysql/errc.hpp"
|
||||
#include "boost/mysql/error.hpp"
|
||||
#include "boost/mysql/execute_params.hpp"
|
||||
#include "boost/mysql/prepared_statement.hpp"
|
||||
#include "boost/mysql/statement_base.hpp"
|
||||
#include "boost/mysql/row.hpp"
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <memory>
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset<Stream>>&& r)
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_resultset_ptr> (
|
||||
r.err,
|
||||
@@ -106,7 +106,7 @@ class async_callback_statement : public er_statement_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_statement_base<Stream>::er_statement_base;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<er_resultset_ptr> execute_params(
|
||||
const boost::mysql::execute_params<value_list_it>& params
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::prepared_statement<Stream>>&& r)
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::statement_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_statement_ptr> (
|
||||
r.err,
|
||||
@@ -147,8 +147,8 @@ class async_callback_connection : public er_connection_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_connection_base<Stream>::er_connection_base;
|
||||
using statement_type = boost::mysql::prepared_statement<Stream>;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using statement_type = boost::mysql::statement_base<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<no_result> physical_connect(er_endpoint kind) override
|
||||
{
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include "boost/mysql/errc.hpp"
|
||||
#include "boost/mysql/error.hpp"
|
||||
#include "boost/mysql/execute_params.hpp"
|
||||
#include "boost/mysql/prepared_statement.hpp"
|
||||
#include "boost/mysql/statement_base.hpp"
|
||||
#include "boost/mysql/row.hpp"
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <memory>
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset<Stream>>&& r)
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_resultset_ptr> (
|
||||
r.err,
|
||||
@@ -102,7 +102,7 @@ class async_callback_noerrinfo_statement : public er_statement_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_statement_base<Stream>::er_statement_base;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<er_resultset_ptr> execute_params(
|
||||
const boost::mysql::execute_params<value_list_it>& params
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::prepared_statement<Stream>>&& r)
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::statement_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_statement_ptr> (
|
||||
r.err,
|
||||
@@ -142,8 +142,8 @@ class async_callback_noerrinfo_connection : public er_connection_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_connection_base<Stream>::er_connection_base;
|
||||
using statement_type = boost::mysql::prepared_statement<Stream>;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using statement_type = boost::mysql::statement_base<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<no_result> physical_connect(er_endpoint kind) override
|
||||
{
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include "boost/mysql/errc.hpp"
|
||||
#include "boost/mysql/error.hpp"
|
||||
#include "boost/mysql/execute_params.hpp"
|
||||
#include "boost/mysql/prepared_statement.hpp"
|
||||
#include "boost/mysql/statement_base.hpp"
|
||||
#include "boost/mysql/row.hpp"
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <boost/asio/spawn.hpp>
|
||||
#include <memory>
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset<Stream>>&& r)
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_resultset_ptr> (
|
||||
r.err,
|
||||
@@ -97,7 +97,7 @@ class async_coroutine_statement : public er_statement_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_statement_base<Stream>::er_statement_base;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<er_resultset_ptr> execute_params(
|
||||
const boost::mysql::execute_params<value_list_it>& params
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::prepared_statement<Stream>>&& r)
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::statement_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_statement_ptr> (
|
||||
r.err,
|
||||
@@ -139,8 +139,8 @@ class async_coroutine_connection : public er_connection_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_connection_base<Stream>::er_connection_base;
|
||||
using statement_type = boost::mysql::prepared_statement<Stream>;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using statement_type = boost::mysql::statement_base<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<no_result> physical_connect(er_endpoint kind) override
|
||||
{
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
#include "boost/mysql/errc.hpp"
|
||||
#include "boost/mysql/error.hpp"
|
||||
#include "boost/mysql/execute_params.hpp"
|
||||
#include "boost/mysql/prepared_statement.hpp"
|
||||
#include "boost/mysql/statement_base.hpp"
|
||||
#include "boost/mysql/row.hpp"
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <boost/asio/co_spawn.hpp>
|
||||
#include <boost/asio/detached.hpp>
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset<Stream>>&& r)
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_resultset_ptr> (
|
||||
r.err,
|
||||
@@ -125,7 +125,7 @@ class async_coroutinecpp20_statement : public er_statement_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_statement_base<Stream>::er_statement_base;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<er_resultset_ptr> execute_params(
|
||||
const boost::mysql::execute_params<value_list_it>& params
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::prepared_statement<Stream>>&& r)
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::statement_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_statement_ptr> (
|
||||
r.err,
|
||||
@@ -166,8 +166,8 @@ class async_coroutinecpp20_connection : public er_connection_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_connection_base<Stream>::er_connection_base;
|
||||
using statement_type = boost::mysql::prepared_statement<Stream>;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using statement_type = boost::mysql::statement_base<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<no_result> physical_connect(er_endpoint kind) override
|
||||
{
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include "boost/mysql/errc.hpp"
|
||||
#include "boost/mysql/error.hpp"
|
||||
#include "boost/mysql/execute_params.hpp"
|
||||
#include "boost/mysql/prepared_statement.hpp"
|
||||
#include "boost/mysql/statement_base.hpp"
|
||||
#include "boost/mysql/row.hpp"
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <memory>
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset<Stream>>&& r)
|
||||
network_result<er_resultset_ptr> erase_network_result(network_result<boost::mysql::resultset_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_resultset_ptr> (
|
||||
r.err,
|
||||
@@ -114,7 +114,7 @@ class async_future_statement : public er_statement_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_statement_base<Stream>::er_statement_base;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<er_resultset_ptr> execute_params(
|
||||
const boost::mysql::execute_params<value_list_it>& params
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::prepared_statement<Stream>>&& r)
|
||||
network_result<er_statement_ptr> erase_network_result(network_result<boost::mysql::statement_base<Stream>>&& r)
|
||||
{
|
||||
return network_result<er_statement_ptr> (
|
||||
r.err,
|
||||
@@ -155,8 +155,8 @@ class async_future_connection : public er_connection_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_connection_base<Stream>::er_connection_base;
|
||||
using statement_type = boost::mysql::prepared_statement<Stream>;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using statement_type = boost::mysql::statement_base<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<no_result> physical_connect(er_endpoint kind) override
|
||||
{
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include "boost/mysql/errc.hpp"
|
||||
#include "boost/mysql/error.hpp"
|
||||
#include "boost/mysql/execute_params.hpp"
|
||||
#include "boost/mysql/prepared_statement.hpp"
|
||||
#include "boost/mysql/statement_base.hpp"
|
||||
#include "boost/mysql/row.hpp"
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <memory>
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_resultset_ptr> erase_network_result(
|
||||
network_result<boost::mysql::resultset<Stream>>&& r
|
||||
network_result<boost::mysql::resultset_base<Stream>>&& r
|
||||
)
|
||||
{
|
||||
return network_result<er_resultset_ptr> (
|
||||
@@ -111,7 +111,7 @@ class default_completion_tokens_statement : public er_statement_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_statement_base<Stream>::er_statement_base;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<er_resultset_ptr> execute_params(
|
||||
const boost::mysql::execute_params<value_list_it>& params
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
|
||||
template <class Stream>
|
||||
network_result<er_statement_ptr> erase_network_result(
|
||||
network_result<boost::mysql::prepared_statement<Stream>>&& r
|
||||
network_result<boost::mysql::statement_base<Stream>>&& r
|
||||
)
|
||||
{
|
||||
return network_result<er_statement_ptr> (
|
||||
@@ -153,8 +153,8 @@ class default_completion_tokens_connection : public er_connection_base<Stream>
|
||||
{
|
||||
public:
|
||||
using er_connection_base<Stream>::er_connection_base;
|
||||
using statement_type = boost::mysql::prepared_statement<Stream>;
|
||||
using resultset_type = boost::mysql::resultset<Stream>;
|
||||
using statement_type = boost::mysql::statement_base<Stream>;
|
||||
using resultset_type = boost::mysql::resultset_base<Stream>;
|
||||
|
||||
network_result<no_result> physical_connect(er_endpoint kind) override
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define BOOST_MYSQL_TEST_INTEGRATION_UTILS_SRC_ER_IMPL_COMMON_HPP
|
||||
|
||||
#include "boost/mysql/error.hpp"
|
||||
#include "boost/mysql/prepared_statement.hpp"
|
||||
#include "boost/mysql/statement_base.hpp"
|
||||
#include "er_connection.hpp"
|
||||
#include "er_network_variant.hpp"
|
||||
#include "er_resultset.hpp"
|
||||
@@ -74,9 +74,9 @@ template <class Stream>
|
||||
class er_resultset_base : public er_resultset
|
||||
{
|
||||
protected:
|
||||
resultset<Stream> r_;
|
||||
resultset_base<Stream> r_;
|
||||
public:
|
||||
er_resultset_base(resultset<Stream>&& r): r_(std::move(r)) {}
|
||||
er_resultset_base(resultset_base<Stream>&& r): r_(std::move(r)) {}
|
||||
bool valid() const override { return r_.valid(); }
|
||||
bool complete() const override { return r_.complete(); }
|
||||
const std::vector<metadata>& fields() const override { return r_.fields(); }
|
||||
@@ -90,9 +90,9 @@ template <class Stream>
|
||||
class er_statement_base : public er_statement
|
||||
{
|
||||
protected:
|
||||
prepared_statement<Stream> stmt_;
|
||||
statement_base<Stream> stmt_;
|
||||
public:
|
||||
er_statement_base(prepared_statement<Stream>&& stmt): stmt_(std::move(stmt)) {}
|
||||
er_statement_base(statement_base<Stream>&& stmt): stmt_(std::move(stmt)) {}
|
||||
bool valid() const override { return stmt_.valid(); }
|
||||
unsigned id() const override { return stmt_.id(); }
|
||||
unsigned num_params() const override { return stmt_.num_params(); }
|
||||
@@ -140,13 +140,13 @@ public:
|
||||
|
||||
// Helpers to erase type
|
||||
template <template <typename> class ErPreparedStatement, class Stream>
|
||||
er_statement_ptr erase_statement(prepared_statement<Stream>&& stmt)
|
||||
er_statement_ptr erase_statement(statement_base<Stream>&& stmt)
|
||||
{
|
||||
return er_statement_ptr(new ErPreparedStatement<Stream>(std::move(stmt)));
|
||||
}
|
||||
|
||||
template <template <typename> class ErResultset, class Stream>
|
||||
er_resultset_ptr erase_resultset(resultset<Stream>&& r)
|
||||
er_resultset_ptr erase_resultset(resultset_base<Stream>&& r)
|
||||
{
|
||||
return er_resultset_ptr(new ErResultset<Stream>(std::move(r)));
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
#include "boost/mysql/errc.hpp"
|
||||
#include "boost/mysql/error.hpp"
|
||||
#include "boost/mysql/execute_params.hpp"
|
||||
#include "boost/mysql/prepared_statement.hpp"
|
||||
#include "boost/mysql/statement_base.hpp"
|
||||
#include "boost/mysql/row.hpp"
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
#include "boost/mysql/errc.hpp"
|
||||
#include "boost/mysql/error.hpp"
|
||||
#include "boost/mysql/execute_params.hpp"
|
||||
#include "boost/mysql/prepared_statement.hpp"
|
||||
#include "boost/mysql/statement_base.hpp"
|
||||
#include "boost/mysql/row.hpp"
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/connection.hpp>
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
#include <boost/mysql/tcp.hpp>
|
||||
#include "test_common.hpp"
|
||||
#include "test_stream.hpp"
|
||||
#include <boost/mysql/prepared_statement.hpp>
|
||||
#include <boost/mysql/statement_base.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
#include <boost/test/unit_test_suite.hpp>
|
||||
|
||||
using namespace boost::mysql::detail;
|
||||
using boost::mysql::prepared_statement;
|
||||
using boost::mysql::statement_base;
|
||||
|
||||
using chan_t = boost::mysql::detail::channel<boost::mysql::test::test_stream>;
|
||||
using stmt_t = prepared_statement<boost::mysql::test::test_stream>;
|
||||
using stmt_t = statement_base<boost::mysql::test::test_stream>;
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(test_prepared_statement)
|
||||
|
||||
@@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE(rebind_executor)
|
||||
{
|
||||
using other_executor = boost::asio::strand<boost::asio::io_context::executor_type>;
|
||||
using rebound_type = boost::mysql::tcp_prepared_statement::rebind_executor<other_executor>::other;
|
||||
using expected_type = boost::mysql::prepared_statement<
|
||||
using expected_type = boost::mysql::statement_base<
|
||||
boost::asio::basic_stream_socket<
|
||||
boost::asio::ip::tcp,
|
||||
other_executor
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <boost/mysql/resultset.hpp>
|
||||
#include <boost/mysql/resultset_base.hpp>
|
||||
#include <boost/mysql/tcp.hpp>
|
||||
#include <boost/mysql/detail/protocol/channel.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include "test_stream.hpp"
|
||||
|
||||
using resultset_t = boost::mysql::resultset<boost::mysql::test::test_stream>;
|
||||
using resultset_t = boost::mysql::resultset_base<boost::mysql::test::test_stream>;
|
||||
using chan_t = boost::mysql::detail::channel<boost::mysql::test::test_stream>;
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(test_resultset)
|
||||
@@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE(rebind_executor)
|
||||
{
|
||||
using other_executor = boost::asio::strand<boost::asio::io_context::executor_type>;
|
||||
using rebound_type = boost::mysql::tcp_resultset::rebind_executor<other_executor>::other;
|
||||
using expected_type = boost::mysql::resultset<
|
||||
using expected_type = boost::mysql::resultset_base<
|
||||
boost::asio::basic_stream_socket<
|
||||
boost::asio::ip::tcp,
|
||||
other_executor
|
||||
|
||||
Reference in New Issue
Block a user