Skip to content
Snippets Groups Projects

ENH: Add retrieval and queries to Extern C interface

Merged Florian Spreckelsen requested to merge f-extended-c into f-files
2 unresolved threads
Compare and
8 files
+ 512
74
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -208,7 +208,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();
}
@@ -357,6 +357,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 -> long {
return query_count;
}
/**
* Return the number of sub-requests in this transaction.
*
@@ -367,6 +378,23 @@ public:
return this->request->requests_size();
}
/**
* Get a JSON representation of the response.
*
* 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;
@@ -383,6 +411,7 @@ private:
MultiTransactionRequest *request;
mutable MultiTransactionResponse *response;
std::string error_message;
mutable long query_count;
};
template <class InputIterator>
Loading