89class HAZELCAST_API sql_service
110 template<
typename... Params>
111 boost::future<std::shared_ptr<sql_result>>
execute(
const std::string& query,
112 const Params&... params)
128 boost::future<std::shared_ptr<sql_result>> execute(
131 std::shared_ptr<impl::read_optimized_lru_cache<std::string, int32_t>>
132 partition_argument_index_cache_;
135 friend client::impl::hazelcast_client_instance_impl;
138 client::spi::ClientContext& client_context_;
140 bool is_smart_routing_;
142 struct sql_execute_response_parameters
144 int64_t update_count;
145 std::shared_ptr<sql_row_metadata> row_metadata;
146 std::shared_ptr<sql_page> first_page;
147 boost::optional<impl::sql_error> error;
148 bool is_infinite_rows =
false;
149 bool is_infinite_rows_exist =
false;
150 int32_t partition_argument_index = -1;
151 bool is_partition_argument_index_exists =
false;
154 struct sql_fetch_response_parameters
156 boost::optional<std::shared_ptr<sql_page>> page;
157 boost::optional<impl::sql_error> error;
160 explicit sql_service(client::spi::ClientContext& context);
162 std::shared_ptr<connection::Connection> query_connection();
163 std::shared_ptr<connection::Connection> query_connection(
164 int32_t partition_id);
166 boost::optional<int32_t> extract_partition_id(
167 const sql_statement& statement,
168 const int32_t arg_index)
const;
170 void rethrow(
const std::exception& exc_ptr);
171 void rethrow(
const std::exception& cause_ptr,
172 const std::shared_ptr<connection::Connection>& connection);
174 boost::uuids::uuid client_id();
176 std::shared_ptr<sql_result> handle_execute_response(
177 const std::string& sql_query,
178 const int32_t original_partition_argument_index,
179 protocol::ClientMessage& msg,
180 std::shared_ptr<connection::Connection> connection,
182 int32_t cursor_buffer_size,
183 std::weak_ptr<std::atomic<int32_t>> statement_par_arg_index_ptr);
185 static sql_execute_response_parameters decode_execute_response(
186 protocol::ClientMessage& msg);
188 impl::query_id create_query_id(
189 const std::shared_ptr<connection::Connection>& query_conn);
191 boost::future<std::shared_ptr<sql_page>> fetch_page(
192 const impl::query_id& q_id,
193 int32_t cursor_buffer_size,
194 const std::shared_ptr<connection::Connection>& connection);
196 static sql_fetch_response_parameters decode_fetch_response(
197 protocol::ClientMessage message);
199 static void handle_fetch_response_error(
200 boost::optional<impl::sql_error> error);
208 boost::future<void> close(
209 const std::shared_ptr<connection::Connection>& connection,