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"
48 static constexpr std::chrono::milliseconds TIMEOUT_NOT_SET{ -1 };
54 static constexpr std::chrono::milliseconds TIMEOUT_DISABLED{ 0 };
57 static constexpr std::chrono::milliseconds DEFAULT_TIMEOUT =
61 static constexpr int32_t DEFAULT_CURSOR_BUFFER_SIZE = 4096;
74 const std::string& sql()
const;
103 template<
typename... Param>
115 template<
typename Param>
133 int32_t cursor_buffer_size()
const;
163 std::chrono::milliseconds timeout()
const;
187 sql_expected_result_type expected_result_type()
const;
203 const boost::optional<std::string>& schema()
const;
222 using data = serialization::pimpl::data;
223 using serialization_service = serialization::pimpl::SerializationService;
225 sql_statement(spi::ClientContext& client_context, std::string query);
228 std::vector<data> serialized_parameters_;
229 int32_t cursor_buffer_size_;
230 std::chrono::milliseconds timeout_;
231 sql::sql_expected_result_type expected_result_type_;
232 boost::optional<std::string> schema_;
234 serialization_service& serialization_service_;
239 template<
typename Param>
243 serialized_parameters_.emplace_back(serialization_service_.to_data(param));
248 template<
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.
sql_statement & add_parameter(const Param &value)
Adds a single parameter value to the end of the parameter values list.
sql_statement & expected_result_type(sql_expected_result_type type)
Sets the expected result type.