![]() |
Hazelcast C++ Client
Hazelcast C++ Client Library
|
SQL query result. More...
#include <sql_result.h>
Classes | |
class | page_iterator |
Copy is allowed for convenience but it does shallow copy so it should be avoided. More... | |
class | page_iterator_sync |
Copy is allowed for convenience but it does shallow copy so it should be avoided. More... | |
class | row_iterator_sync |
Copy is allowed for convenience but it does shallow copy so it should be avoided. More... |
Public Member Functions | |
virtual | ~sql_result () |
The destructor closes the result if it were open. | |
bool | row_set () const |
Return whether this result has rows to iterate using the iterator() method. | |
const sql_row_metadata & | row_metadata () const |
Gets the row metadata. | |
int64_t | update_count () const |
Returns the number of rows updated by the statement or -1 if this result is a row set. | |
boost::future< void > | close () |
Release the resources associated with the query result. | |
page_iterator | iterator () |
Returns an iterator over the result pages. | |
page_iterator_sync | pbegin (std::chrono::milliseconds timeout=std::chrono::milliseconds{ -1 }) |
page_iterator_sync | pend () |
row_iterator_sync | begin (std::chrono::milliseconds timeout=std::chrono::milliseconds{ -1 }) |
row_iterator_sync | end () |
Friends | |
class | sql_service |
SQL query result.
Depending on the statement type it represents a pages of rows or an update count.
Code example:
auto result = hz.get_sql().execute("SELECT * FROM person"); for (auto itr = result.iterator(); itr.has_next();) { auto page = itr.next().get(); for (auto const &row : page->rows()) { // Process the row. } }
auto updated = hz.get_sql().execute("UPDATE ...").get().update_count();
You don't need to call close() in this case.
Definition at line 67 of file sql_result.h.
|
virtual |
The destructor closes the result if it were open.
Definition at line 955 of file sql.cpp.
sql_result::row_iterator_sync hazelcast::client::sql::sql_result::begin | ( | std::chrono::milliseconds | timeout = std::chrono::milliseconds{ -1 } | ) |
Definition at line 815 of file sql.cpp.
boost::future< void > hazelcast::client::sql::sql_result::close | ( | ) |
Release the resources associated with the query result.
The query engine delivers the rows asynchronously. The query may become inactive even before all rows are consumed. The invocation of this command will cancel the execution of the query on all members if the query is still active. Otherwise it is no-op. For a result with an update count it is always no-op.
Definition at line 901 of file sql.cpp.
sql_result::row_iterator_sync hazelcast::client::sql::sql_result::end | ( | ) |
sql_result::page_iterator hazelcast::client::sql::sql_result::iterator | ( | ) |
Returns an iterator over the result pages.
The iterator may be requested only once.
exception::illegal_state | if the iterator is requested more than once or if this result does not have any pages. |
Definition at line 783 of file sql.cpp.
sql_result::page_iterator_sync hazelcast::client::sql::sql_result::pbegin | ( | std::chrono::milliseconds | timeout = std::chrono::milliseconds{ -1 } | ) |
Definition at line 803 of file sql.cpp.
sql_result::page_iterator_sync hazelcast::client::sql::sql_result::pend | ( | ) |
const sql_row_metadata & hazelcast::client::sql::sql_result::row_metadata | ( | ) | const |
Gets the row metadata.
illegal_state_exception | if this result doesn't have rows, but only an update count |
Definition at line 945 of file sql.cpp.
bool hazelcast::client::sql::sql_result::row_set | ( | ) | const |
Return whether this result has rows to iterate using the iterator() method.
Definition at line 777 of file sql.cpp.
int64_t hazelcast::client::sql::sql_result::update_count | ( | ) | const |
|
friend |
Definition at line 308 of file sql_result.h.