Skip to content
Snippets Groups Projects
Verified Commit d85907da authored by Timm Fitschen's avatar Timm Fitschen
Browse files

add empty result set when single count query

parent 3f1b8052
No related branches found
No related tags found
1 merge request!7ENH: Support FIND and COUNT queries
Pipeline #11570 canceled
......@@ -389,6 +389,23 @@ public:
return this->request->requests_size();
}
/**
* Get a JSON representation of the respone.
*
* For debugging.
*/
inline auto ResponseToString() const -> const std::string {
google::protobuf::util::JsonOptions options;
std::string out;
google::protobuf::util::MessageToJsonString(*this->response, &out, options);
return out;
}
/**
* Get a JSON representation of the request.
*
* For debugging.
*/
inline auto RequestToString() const -> const std::string {
google::protobuf::util::JsonOptions options;
std::string out;
......
......@@ -300,6 +300,9 @@ auto Transaction::WaitForIt() const noexcept -> TransactionStatus {
} break;
case QueryResponseCase::kCountResult: {
this->query_count = retrieve_response->count_result();
std::vector<std::unique_ptr<Entity>> entities;
this->result_set =
std::make_unique<MultiResultSet>(std::move(entities));
} break;
default:
// TODO(tf) Error
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment