Skip to content
Snippets Groups Projects

F files

Merged Timm Fitschen requested to merge f-files into dev
4 files
+ 110
50
Compare changes
  • Side-by-side
  • Inline

Files

+ 30
1
@@ -215,7 +215,7 @@ private:
class MultiResultSet : public ResultSet {
public:
~MultiResultSet() = default;
explicit MultiResultSet(MultiTransactionResponse *response);
explicit MultiResultSet(std::vector<std::unique_ptr<Entity>> result_set);
[[nodiscard]] inline auto Size() const noexcept -> int override {
return this->entities.size();
}
@@ -384,6 +384,17 @@ public:
return *result_set;
}
/**
* Return the result of a count query
*
* Only meaningful if there was exactly one COUNT query executed in
* this transaction. In all other cases, the return value will be
* -1.
*/
[[nodiscard]] inline auto GetCountResult() const -> int {
return query_count;
}
/**
* Return the number of sub-requests in this transaction.
*
@@ -394,6 +405,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;
@@ -411,6 +439,7 @@ private:
MultiTransactionRequest *request;
mutable MultiTransactionResponse *response;
std::string error_message;
mutable long query_count;
};
template <class InputIterator>
Loading