22#include <boost/optional/optional.hpp>
24#include "hazelcast/util/export.h"
25#include "hazelcast/client/serialization/pimpl/data.h"
26#include "hazelcast/client/serialization/serialization.h"
27#include "hazelcast/client/sql/sql_expected_result_type.h"
74 const std::string&
sql()
const;
103 template<
typename... Param>
115 template<
typename Param>
163 std::chrono::milliseconds
timeout()
const;
210 const boost::optional<std::string>&
schema()
const;
229 using data = serialization::pimpl::data;
230 using serialization_service = serialization::pimpl::SerializationService;
232 sql_statement(spi::ClientContext& client_context, std::string query);
248 std::vector<data> serialized_parameters_;
249 int32_t cursor_buffer_size_;
250 std::chrono::milliseconds timeout_;
251 sql::sql_expected_result_type expected_result_type_;
252 boost::optional<std::string> schema_;
253 std::shared_ptr<std::atomic<int32_t>> partition_argument_index_;
255 serialization_service& serialization_service_;
260template<
typename Param>
264 serialized_parameters_.emplace_back(serialization_service_.to_data(param));
269template<
typename... Param>
A service to execute SQL statements.
Definition of an SQL statement.
sql_statement & set_parameters(Param... params)
Sets the values for statement parameters.
static constexpr std::chrono::milliseconds TIMEOUT_DISABLED
Value for the timeout that is disabled, meaning there's no time limit to run a query.
sql_statement & add_parameter(const Param &value)
Adds a single parameter value to the end of the parameter values list.
std::shared_ptr< std::atomic< int32_t > > partition_argument_index() const
Get the partition argument index value.
static constexpr int32_t DEFAULT_CURSOR_BUFFER_SIZE
Default cursor buffer size.
const boost::optional< std::string > & schema() const
Gets the schema name.
std::chrono::milliseconds timeout() const
Gets the execution timeout in milliseconds.
sql_statement & clear_parameters()
Clears statement parameter values.
static constexpr std::chrono::milliseconds DEFAULT_TIMEOUT
Default timeout.
sql_statement(hazelcast_client &client, std::string query)
Creates a statement with the given query.
int32_t cursor_buffer_size() const
Gets the cursor buffer size (measured in the number of rows).
const std::string & sql() const
static constexpr std::chrono::milliseconds TIMEOUT_NOT_SET
Value for the timeout that is not set.
sql_statement & expected_result_type(sql_expected_result_type type)
Sets the expected result type.
sql_expected_result_type expected_result_type() const
Gets the expected result type.