From 03e892bc200693257ca8da33233982bef019ff36 Mon Sep 17 00:00:00 2001 From: Ruben Perez Date: Wed, 5 Oct 2022 15:21:41 +0200 Subject: [PATCH] Renamed resultset and prepared_statement => bases --- include/boost/mysql/connection.hpp | 130 +++++++++--------- .../network_algorithms/execute_generic.hpp | 6 +- .../network_algorithms/execute_query.hpp | 6 +- .../network_algorithms/execute_statement.hpp | 6 +- .../impl/execute_generic.hpp | 10 +- .../network_algorithms/impl/execute_query.hpp | 4 +- .../impl/execute_statement.hpp | 6 +- .../impl/prepare_statement.hpp | 12 +- .../network_algorithms/impl/read_all_rows.hpp | 32 ++--- .../network_algorithms/impl/read_one_row.hpp | 24 ++-- .../impl/read_some_rows.hpp | 28 ++-- .../network_algorithms/prepare_statement.hpp | 6 +- .../network_algorithms/read_all_rows.hpp | 6 +- .../network_algorithms/read_one_row.hpp | 6 +- .../network_algorithms/read_some_rows.hpp | 6 +- .../mysql/detail/protocol/deserialize_row.hpp | 14 +- include/boost/mysql/execute_params.hpp | 12 +- include/boost/mysql/impl/connection.hpp | 64 ++++----- include/boost/mysql/impl/execute_params.hpp | 4 +- include/boost/mysql/metadata.hpp | 2 +- .../{resultset.hpp => resultset_base.hpp} | 42 +++--- include/boost/mysql/row.hpp | 2 +- ...pared_statement.hpp => statement_base.hpp} | 20 +-- include/boost/mysql/tcp.hpp | 2 - include/boost/mysql/tcp_ssl.hpp | 2 - include/boost/mysql/unix.hpp | 2 - include/boost/mysql/unix_ssl.hpp | 2 - test/integration/database_types.cpp | 2 +- test/integration/prepare_statement.cpp | 8 +- test/integration/query.cpp | 4 +- test/integration/resultset.cpp | 30 ++-- test/integration/utils/src/async_callback.cpp | 14 +- .../utils/src/async_callback_noerrinfo.cpp | 14 +- .../integration/utils/src/async_coroutine.cpp | 14 +- .../utils/src/async_coroutinecpp20.cpp | 14 +- test/integration/utils/src/async_future.cpp | 14 +- .../utils/src/default_completion_tokens.cpp | 14 +- test/integration/utils/src/er_impl_common.hpp | 14 +- test/integration/utils/src/sync_errc.cpp | 4 +- test/integration/utils/src/sync_exc.cpp | 4 +- test/unit/prepared_statement.cpp | 8 +- test/unit/resultset.cpp | 6 +- 42 files changed, 306 insertions(+), 314 deletions(-) rename include/boost/mysql/{resultset.hpp => resultset_base.hpp} (82%) rename include/boost/mysql/{prepared_statement.hpp => statement_base.hpp} (80%) diff --git a/include/boost/mysql/connection.hpp b/include/boost/mysql/connection.hpp index e93e1971..93b388ea 100644 --- a/include/boost/mysql/connection.hpp +++ b/include/boost/mysql/connection.hpp @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -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)`. + * `void(boost::mysql::error_code, boost::mysql::resultset_base)`. */ 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)`. + * `void(boost::mysql::error_code, boost::mysql::resultset_base)`. */ 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)` + * `void(boost::mysql::error_code, boost::mysql::statement_base)` */ 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)` + * `void(boost::mysql::error_code, boost::mysql::statement_base)` */ 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 > 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 > 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)`. + * `void(boost::mysql::error_code, boost::mysql::resultset_base)`. */ 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)`. + * `void(boost::mysql::error_code, boost::mysql::resultset_base)`. */ 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 void execute_statement( const execute_params& 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 void execute_statement( const execute_params& 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)`. + * `void(boost::mysql::error_code, boost::mysql::resultset_base)`. */ template < class FieldViewFwdIterator, @@ -647,7 +647,7 @@ public: BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_execute_statement( const execute_params& 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)`. + * `void(boost::mysql::error_code, boost::mysql::resultset_base)`. */ template < class FieldViewFwdIterator, @@ -682,7 +682,7 @@ public: BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_execute_statement( const execute_params& 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(token)); + return async_read_one_row(resultset_base, output, shared_info(), std::forward(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(token)); + return async_read_some_rows(resultset_base, output, shared_info(), std::forward(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(token)); + return async_read_all_rows(resultset_base, output, shared_info(), std::forward(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) diff --git a/include/boost/mysql/detail/network_algorithms/execute_generic.hpp b/include/boost/mysql/detail/network_algorithms/execute_generic.hpp index 1ce2f53f..2264bd71 100644 --- a/include/boost/mysql/detail/network_algorithms/execute_generic.hpp +++ b/include/boost/mysql/detail/network_algorithms/execute_generic.hpp @@ -9,7 +9,7 @@ #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_GENERIC_HPP #include -#include +#include #include #include @@ -23,7 +23,7 @@ void execute_generic( resultset_encoding encoding, channel& 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& chan, const Serializable& request, - resultset& output, + resultset_base& output, error_info& info, CompletionToken&& token ); diff --git a/include/boost/mysql/detail/network_algorithms/execute_query.hpp b/include/boost/mysql/detail/network_algorithms/execute_query.hpp index de0260a2..c6c2d4f4 100644 --- a/include/boost/mysql/detail/network_algorithms/execute_query.hpp +++ b/include/boost/mysql/detail/network_algorithms/execute_query.hpp @@ -9,7 +9,7 @@ #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP #include -#include +#include #include #include @@ -22,7 +22,7 @@ template void execute_query( channel& 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& chan, boost::string_view query, - resultset& output, + resultset_base& output, error_info& info, CompletionToken&& token ); diff --git a/include/boost/mysql/detail/network_algorithms/execute_statement.hpp b/include/boost/mysql/detail/network_algorithms/execute_statement.hpp index 768aa6a6..ee09e9f3 100644 --- a/include/boost/mysql/detail/network_algorithms/execute_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/execute_statement.hpp @@ -9,7 +9,7 @@ #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP #include -#include +#include #include #include @@ -21,7 +21,7 @@ template void execute_statement( channel& channel, const execute_params& 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& chan, const execute_params& params, - resultset& output, + resultset_base& output, error_info& info, CompletionToken&& token ); diff --git a/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp b/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp index e77fb53a..829a0843 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -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& 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& channel, const Serializable& request, - resultset& output, + resultset_base& output, error_info& info, CompletionToken&& token ) diff --git a/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp b/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp index b87eef29..81d8f93c 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp @@ -19,7 +19,7 @@ template void boost::mysql::detail::execute_query( channel& 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& chan, boost::string_view query, - resultset& output, + resultset_base& output, error_info& info, CompletionToken&& token ) diff --git a/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp b/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp index 7ecb6f9f..e79304f7 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp @@ -10,7 +10,7 @@ #pragma once -#include +#include #include #include #include @@ -45,7 +45,7 @@ template void boost::mysql::detail::execute_statement( channel& chan, const execute_params& 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& chan, const execute_params& params, - resultset& output, + resultset_base& output, error_info& info, CompletionToken&& token ) diff --git a/include/boost/mysql/detail/network_algorithms/impl/prepare_statement.hpp b/include/boost/mysql/detail/network_algorithms/impl/prepare_statement.hpp index 81a0f426..8a553393 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/prepare_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/prepare_statement.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include @@ -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 prepare_statement_processor( channel& 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 void boost::mysql::detail::prepare_statement( channel& 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& chan, boost::string_view statement, - prepared_statement& output, + statement_base& output, error_info& info, CompletionToken&& token ) diff --git a/include/boost/mysql/detail/network_algorithms/impl/read_all_rows.hpp b/include/boost/mysql/detail/network_algorithms/impl/read_all_rows.hpp index ffb419a1..9f5ae823 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/read_all_rows.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/read_all_rows.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -28,7 +28,7 @@ namespace detail { template inline void process_all_rows( channel& 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& chan_; error_info& output_info_; - resultset& resultset_; + resultset_base& resultset_; rows_view& output_; read_all_rows_op( channel& 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 void boost::mysql::detail::read_all_rows( channel& 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& 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( channel, output_info, - resultset, + result, output ), token, diff --git a/include/boost/mysql/detail/network_algorithms/impl/read_one_row.hpp b/include/boost/mysql/detail/network_algorithms/impl/read_one_row.hpp index 01b000c9..061100b0 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/read_one_row.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/read_one_row.hpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -26,7 +26,7 @@ template inline bool process_one_row( boost::asio::const_buffer read_message, channel& 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& chan_; error_info& output_info_; - resultset& resultset_; + resultset_base& resultset_; row& output_; read_one_row_op( channel& 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 bool boost::mysql::detail::read_one_row( channel& 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& 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( channel, output_info, - resultset, + result, output ), token, diff --git a/include/boost/mysql/detail/network_algorithms/impl/read_some_rows.hpp b/include/boost/mysql/detail/network_algorithms/impl/read_some_rows.hpp index fbde4854..1f963afa 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/read_some_rows.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/read_some_rows.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -27,7 +27,7 @@ namespace detail { template inline void process_some_rows( channel& 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& chan_; error_info& output_info_; - resultset& resultset_; + resultset_base& resultset_; rows_view& output_; read_some_rows_op( channel& 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 void boost::mysql::detail::read_some_rows( channel& 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 @@ -169,7 +169,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE( ) boost::mysql::detail::async_read_some_rows( channel& 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( channel, output_info, - resultset, + result, output ), token, diff --git a/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp b/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp index 735ed343..eb83729f 100644 --- a/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp @@ -9,7 +9,7 @@ #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP #include -#include +#include #include #include @@ -22,7 +22,7 @@ template void prepare_statement( channel& 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& chan, boost::string_view statement, - prepared_statement& output, + statement_base& output, error_info& info, CompletionToken&& token ); diff --git a/include/boost/mysql/detail/network_algorithms/read_all_rows.hpp b/include/boost/mysql/detail/network_algorithms/read_all_rows.hpp index f1270460..893ddfb4 100644 --- a/include/boost/mysql/detail/network_algorithms/read_all_rows.hpp +++ b/include/boost/mysql/detail/network_algorithms/read_all_rows.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -21,7 +21,7 @@ namespace detail { template void read_all_rows( channel& channel, - resultset& resultset, + resultset_base& result, rows_view& output, error_code& err, error_info& info @@ -31,7 +31,7 @@ template BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_read_all_rows( channel& channel, - resultset& resultset, + resultset_base& result, rows_view& output, error_info& output_info, CompletionToken&& token diff --git a/include/boost/mysql/detail/network_algorithms/read_one_row.hpp b/include/boost/mysql/detail/network_algorithms/read_one_row.hpp index bb89f756..fd99d83f 100644 --- a/include/boost/mysql/detail/network_algorithms/read_one_row.hpp +++ b/include/boost/mysql/detail/network_algorithms/read_one_row.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -21,7 +21,7 @@ namespace detail { template bool read_one_row( channel& channel, - resultset& resultset, + resultset_base& result, row_view& output, error_code& err, error_info& info @@ -31,7 +31,7 @@ template BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code, bool)) async_read_one_row( channel& channel, - resultset& resultset, + resultset_base& result, row_view& output, error_info& output_info, CompletionToken&& token diff --git a/include/boost/mysql/detail/network_algorithms/read_some_rows.hpp b/include/boost/mysql/detail/network_algorithms/read_some_rows.hpp index 29a26556..d1e700bd 100644 --- a/include/boost/mysql/detail/network_algorithms/read_some_rows.hpp +++ b/include/boost/mysql/detail/network_algorithms/read_some_rows.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -21,7 +21,7 @@ namespace detail { template void read_some_rows( channel& channel, - resultset& resultset, + resultset_base& result, rows_view& output, error_code& err, error_info& info @@ -31,7 +31,7 @@ template BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_read_some_rows( channel& channel, - resultset& resultset, + resultset_base& result, rows_view& output, error_info& output_info, CompletionToken&& token diff --git a/include/boost/mysql/detail/protocol/deserialize_row.hpp b/include/boost/mysql/detail/protocol/deserialize_row.hpp index 636b8afa..4998a502 100644 --- a/include/boost/mysql/detail/protocol/deserialize_row.hpp +++ b/include/boost/mysql/detail/protocol/deserialize_row.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -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& 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; diff --git a/include/boost/mysql/execute_params.hpp b/include/boost/mysql/execute_params.hpp index 80462134..ab32ee2a 100644 --- a/include/boost/mysql/execute_params.hpp +++ b/include/boost/mysql/execute_params.hpp @@ -8,7 +8,7 @@ #ifndef BOOST_MYSQL_EXECUTE_PARAMS_HPP #define BOOST_MYSQL_EXECUTE_PARAMS_HPP -#include +#include #include #include #include @@ -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 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 > constexpr auto make_execute_params( - const prepared_statement& stmt, + const statement_base& stmt, const FieldViewCollection& col ) -> execute_params { diff --git a/include/boost/mysql/impl/connection.hpp b/include/boost/mysql/impl/connection.hpp index 8ccaeb7b..7160f848 100644 --- a/include/boost/mysql/impl/connection.hpp +++ b/include/boost/mysql/impl/connection.hpp @@ -12,8 +12,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -129,7 +129,7 @@ boost::mysql::connection::async_handshake( template void boost::mysql::connection::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::query( template void boost::mysql::connection::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::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::async_query( template void boost::mysql::connection::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::prepare_statement( template void boost::mysql::connection::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::async_prepare_statement( boost::string_view statement, - prepared_statement& output, + statement_base& output, error_info& output_info, CompletionToken&& token ) @@ -230,7 +230,7 @@ template template void boost::mysql::connection::execute_statement( const execute_params& params, - resultset& result, + resultset_base& result, error_code& err, error_info& info ) @@ -249,7 +249,7 @@ template template void boost::mysql::connection::execute_statement( const execute_params& params, - resultset& result + resultset_base& result ) { detail::error_block blk; @@ -274,7 +274,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE( ) boost::mysql::connection::async_execute_statement( const execute_params& params, - resultset& result, + resultset_base& result, error_info& output_info, CompletionToken&& token ) @@ -292,7 +292,7 @@ boost::mysql::connection::async_execute_statement( // Close statement template void boost::mysql::connection::close_statement( - const prepared_statement& stmt, + const statement_base& stmt, error_code& code, error_info& info ) @@ -303,7 +303,7 @@ void boost::mysql::connection::close_statement( template void boost::mysql::connection::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::async_close_statement( - const prepared_statement& stmt, + const statement_base& stmt, error_info& output_info, CompletionToken&& token ) @@ -338,25 +338,25 @@ boost::mysql::connection::async_close_statement( // Read one row template bool boost::mysql::connection::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 bool boost::mysql::connection::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::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::async_read_one_row( output_info.clear(); return detail::async_read_one_row( get_channel(), - resultset, + result, output, output_info, std::forward(token) @@ -389,25 +389,25 @@ boost::mysql::connection::async_read_one_row( // Read some rows template void boost::mysql::connection::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 void boost::mysql::connection::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::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::async_read_some_rows( output_info.clear(); return detail::async_read_some_rows( get_channel(), - resultset, + result, output, output_info, std::forward(token) @@ -439,25 +439,25 @@ boost::mysql::connection::async_read_some_rows( // Read all rows template void boost::mysql::connection::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 void boost::mysql::connection::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::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::async_read_all_rows( output_info.clear(); return detail::async_read_all_rows( get_channel(), - resultset, + result, output, output_info, std::forward(token) diff --git a/include/boost/mysql/impl/execute_params.hpp b/include/boost/mysql/impl/execute_params.hpp index 85a047bb..19600be9 100644 --- a/include/boost/mysql/impl/execute_params.hpp +++ b/include/boost/mysql/impl/execute_params.hpp @@ -22,7 +22,7 @@ template 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 boost::mysql::execute_params::execute_params( - const prepared_statement& stmt, + const statement_base& stmt, FieldViewFwdIterator first, FieldViewFwdIterator last ) : diff --git a/include/boost/mysql/metadata.hpp b/include/boost/mysql/metadata.hpp index 2b4882ad..ac4a80e3 100644 --- a/include/boost/mysql/metadata.hpp +++ b/include/boost/mysql/metadata.hpp @@ -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 { diff --git a/include/boost/mysql/resultset.hpp b/include/boost/mysql/resultset_base.hpp similarity index 82% rename from include/boost/mysql/resultset.hpp rename to include/boost/mysql/resultset_base.hpp index bc5d7c69..30ca0701 100644 --- a/include/boost/mysql/resultset.hpp +++ b/include/boost/mysql/resultset_base.hpp @@ -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 #include @@ -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&& meta, detail::resultset_encoding encoding) noexcept: + resultset_base(std::vector&& 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(); } }; diff --git a/include/boost/mysql/row.hpp b/include/boost/mysql/row.hpp index 253c2fe2..25d5c438 100644 --- a/include/boost/mysql/row.hpp +++ b/include/boost/mysql/row.hpp @@ -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 diff --git a/include/boost/mysql/prepared_statement.hpp b/include/boost/mysql/statement_base.hpp similarity index 80% rename from include/boost/mysql/prepared_statement.hpp rename to include/boost/mysql/statement_base.hpp index cad07f8e..74ab0f4b 100644 --- a/include/boost/mysql/prepared_statement.hpp +++ b/include/boost/mysql/statement_base.hpp @@ -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 @@ -25,34 +25,34 @@ constexpr std::array 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 diff --git a/include/boost/mysql/tcp.hpp b/include/boost/mysql/tcp.hpp index 71c08da1..d5799750 100644 --- a/include/boost/mysql/tcp.hpp +++ b/include/boost/mysql/tcp.hpp @@ -9,8 +9,6 @@ #define BOOST_MYSQL_TCP_HPP #include -#include -#include #include namespace boost { diff --git a/include/boost/mysql/tcp_ssl.hpp b/include/boost/mysql/tcp_ssl.hpp index 52a480af..5ca3a42b 100644 --- a/include/boost/mysql/tcp_ssl.hpp +++ b/include/boost/mysql/tcp_ssl.hpp @@ -9,8 +9,6 @@ #define BOOST_MYSQL_TCP_SSL_HPP #include -#include -#include #include #include diff --git a/include/boost/mysql/unix.hpp b/include/boost/mysql/unix.hpp index 4e356b20..62f72c0f 100644 --- a/include/boost/mysql/unix.hpp +++ b/include/boost/mysql/unix.hpp @@ -9,8 +9,6 @@ #define BOOST_MYSQL_UNIX_HPP #include -#include -#include #include namespace boost { diff --git a/include/boost/mysql/unix_ssl.hpp b/include/boost/mysql/unix_ssl.hpp index d10b8ff3..e2539703 100644 --- a/include/boost/mysql/unix_ssl.hpp +++ b/include/boost/mysql/unix_ssl.hpp @@ -9,8 +9,6 @@ #define BOOST_MYSQL_UNIX_SSL_HPP #include -#include -#include #include #include diff --git a/test/integration/database_types.cpp b/test/integration/database_types.cpp index 4cf9ddc2..8a9be654 100644 --- a/test/integration/database_types.cpp +++ b/test/integration/database_types.cpp @@ -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(); diff --git a/test/integration/prepare_statement.cpp b/test/integration/prepare_statement.cpp index 5694ce17..0f711466 100644 --- a/test/integration/prepare_statement.cpp +++ b/test/integration/prepare_statement.cpp @@ -5,7 +5,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include +#include #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()); } diff --git a/test/integration/query.cpp b/test/integration/query.cpp index 460f386f..90f9f1fd 100644 --- a/test/integration/query.cpp +++ b/test/integration/query.cpp @@ -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()); diff --git a/test/integration/resultset.cpp b/test/integration/resultset.cpp index 34b25f00..d73a5e1d 100644 --- a/test/integration/resultset.cpp +++ b/test/integration/resultset.cpp @@ -5,7 +5,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include +#include #include #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()); diff --git a/test/integration/utils/src/async_callback.cpp b/test/integration/utils/src/async_callback.cpp index 72088f5b..07b16a69 100644 --- a/test/integration/utils/src/async_callback.cpp +++ b/test/integration/utils/src/async_callback.cpp @@ -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 +#include #include #include @@ -92,7 +92,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -106,7 +106,7 @@ class async_callback_statement : public er_statement_base { public: using er_statement_base::er_statement_base; - using resultset_type = boost::mysql::resultset; + using resultset_type = boost::mysql::resultset_base; network_result execute_params( const boost::mysql::execute_params& params @@ -133,7 +133,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -147,8 +147,8 @@ class async_callback_connection : public er_connection_base { public: using er_connection_base::er_connection_base; - using statement_type = boost::mysql::prepared_statement; - using resultset_type = boost::mysql::resultset; + using statement_type = boost::mysql::statement_base; + using resultset_type = boost::mysql::resultset_base; network_result physical_connect(er_endpoint kind) override { diff --git a/test/integration/utils/src/async_callback_noerrinfo.cpp b/test/integration/utils/src/async_callback_noerrinfo.cpp index e33842eb..06e0dedc 100644 --- a/test/integration/utils/src/async_callback_noerrinfo.cpp +++ b/test/integration/utils/src/async_callback_noerrinfo.cpp @@ -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 +#include #include #include @@ -89,7 +89,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -102,7 +102,7 @@ class async_callback_noerrinfo_statement : public er_statement_base { public: using er_statement_base::er_statement_base; - using resultset_type = boost::mysql::resultset; + using resultset_type = boost::mysql::resultset_base; network_result execute_params( const boost::mysql::execute_params& params @@ -129,7 +129,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -142,8 +142,8 @@ class async_callback_noerrinfo_connection : public er_connection_base { public: using er_connection_base::er_connection_base; - using statement_type = boost::mysql::prepared_statement; - using resultset_type = boost::mysql::resultset; + using statement_type = boost::mysql::statement_base; + using resultset_type = boost::mysql::resultset_base; network_result physical_connect(er_endpoint kind) override { diff --git a/test/integration/utils/src/async_coroutine.cpp b/test/integration/utils/src/async_coroutine.cpp index 775e7929..c36af2eb 100644 --- a/test/integration/utils/src/async_coroutine.cpp +++ b/test/integration/utils/src/async_coroutine.cpp @@ -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 +#include #include #include #include @@ -83,7 +83,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -97,7 +97,7 @@ class async_coroutine_statement : public er_statement_base { public: using er_statement_base::er_statement_base; - using resultset_type = boost::mysql::resultset; + using resultset_type = boost::mysql::resultset_base; network_result execute_params( const boost::mysql::execute_params& params @@ -125,7 +125,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -139,8 +139,8 @@ class async_coroutine_connection : public er_connection_base { public: using er_connection_base::er_connection_base; - using statement_type = boost::mysql::prepared_statement; - using resultset_type = boost::mysql::resultset; + using statement_type = boost::mysql::statement_base; + using resultset_type = boost::mysql::resultset_base; network_result physical_connect(er_endpoint kind) override { diff --git a/test/integration/utils/src/async_coroutinecpp20.cpp b/test/integration/utils/src/async_coroutinecpp20.cpp index 0580d93a..41f331c3 100644 --- a/test/integration/utils/src/async_coroutinecpp20.cpp +++ b/test/integration/utils/src/async_coroutinecpp20.cpp @@ -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 +#include #include #include #include @@ -111,7 +111,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -125,7 +125,7 @@ class async_coroutinecpp20_statement : public er_statement_base { public: using er_statement_base::er_statement_base; - using resultset_type = boost::mysql::resultset; + using resultset_type = boost::mysql::resultset_base; network_result execute_params( const boost::mysql::execute_params& params @@ -152,7 +152,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -166,8 +166,8 @@ class async_coroutinecpp20_connection : public er_connection_base { public: using er_connection_base::er_connection_base; - using statement_type = boost::mysql::prepared_statement; - using resultset_type = boost::mysql::resultset; + using statement_type = boost::mysql::statement_base; + using resultset_type = boost::mysql::resultset_base; network_result physical_connect(er_endpoint kind) override { diff --git a/test/integration/utils/src/async_future.cpp b/test/integration/utils/src/async_future.cpp index b1ebc7ca..3869e9e0 100644 --- a/test/integration/utils/src/async_future.cpp +++ b/test/integration/utils/src/async_future.cpp @@ -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 +#include #include #include @@ -100,7 +100,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -114,7 +114,7 @@ class async_future_statement : public er_statement_base { public: using er_statement_base::er_statement_base; - using resultset_type = boost::mysql::resultset; + using resultset_type = boost::mysql::resultset_base; network_result execute_params( const boost::mysql::execute_params& params @@ -141,7 +141,7 @@ public: }; template -network_result erase_network_result(network_result>&& r) +network_result erase_network_result(network_result>&& r) { return network_result ( r.err, @@ -155,8 +155,8 @@ class async_future_connection : public er_connection_base { public: using er_connection_base::er_connection_base; - using statement_type = boost::mysql::prepared_statement; - using resultset_type = boost::mysql::resultset; + using statement_type = boost::mysql::statement_base; + using resultset_type = boost::mysql::resultset_base; network_result physical_connect(er_endpoint kind) override { diff --git a/test/integration/utils/src/default_completion_tokens.cpp b/test/integration/utils/src/default_completion_tokens.cpp index 7025571b..0cab981d 100644 --- a/test/integration/utils/src/default_completion_tokens.cpp +++ b/test/integration/utils/src/default_completion_tokens.cpp @@ -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 +#include #include #include @@ -97,7 +97,7 @@ public: template network_result erase_network_result( - network_result>&& r + network_result>&& r ) { return network_result ( @@ -111,7 +111,7 @@ class default_completion_tokens_statement : public er_statement_base { public: using er_statement_base::er_statement_base; - using resultset_type = boost::mysql::resultset; + using resultset_type = boost::mysql::resultset_base; network_result execute_params( const boost::mysql::execute_params& params @@ -139,7 +139,7 @@ public: template network_result erase_network_result( - network_result>&& r + network_result>&& r ) { return network_result ( @@ -153,8 +153,8 @@ class default_completion_tokens_connection : public er_connection_base { public: using er_connection_base::er_connection_base; - using statement_type = boost::mysql::prepared_statement; - using resultset_type = boost::mysql::resultset; + using statement_type = boost::mysql::statement_base; + using resultset_type = boost::mysql::resultset_base; network_result physical_connect(er_endpoint kind) override { diff --git a/test/integration/utils/src/er_impl_common.hpp b/test/integration/utils/src/er_impl_common.hpp index a39e632c..4c865bad 100644 --- a/test/integration/utils/src/er_impl_common.hpp +++ b/test/integration/utils/src/er_impl_common.hpp @@ -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 er_resultset_base : public er_resultset { protected: - resultset r_; + resultset_base r_; public: - er_resultset_base(resultset&& r): r_(std::move(r)) {} + er_resultset_base(resultset_base&& r): r_(std::move(r)) {} bool valid() const override { return r_.valid(); } bool complete() const override { return r_.complete(); } const std::vector& fields() const override { return r_.fields(); } @@ -90,9 +90,9 @@ template class er_statement_base : public er_statement { protected: - prepared_statement stmt_; + statement_base stmt_; public: - er_statement_base(prepared_statement&& stmt): stmt_(std::move(stmt)) {} + er_statement_base(statement_base&& 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