15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_RESULTS_H 16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_RESULTS_H 21 #include <google/spanner/v1/spanner.pb.h> 24 #include <unordered_map> 43 class ResultSourceInterface {
45 virtual ~ResultSourceInterface() =
default;
47 virtual StatusOr<Row> NextRow() = 0;
48 virtual optional<google::spanner::v1::ResultSetMetadata> Metadata() = 0;
49 virtual optional<google::spanner::v1::ResultSetStats> Stats()
const = 0;
71 explicit RowStream(std::unique_ptr<internal::ResultSourceInterface> source)
72 : source_(std::move(source)) {}
92 optional<Timestamp> ReadTimestamp()
const;
95 std::unique_ptr<internal::ResultSourceInterface> source_;
113 explicit DmlResult(std::unique_ptr<internal::ResultSourceInterface> source)
114 : source_(std::move(source)) {}
126 std::int64_t RowsModified()
const;
129 std::unique_ptr<internal::ResultSourceInterface> source_;
154 std::unique_ptr<internal::ResultSourceInterface> source)
155 : source_(std::move(source)) {}
175 optional<Timestamp> ReadTimestamp()
const;
184 optional<std::unordered_map<std::string, std::string>> ExecutionStats()
const;
192 std::unique_ptr<internal::ResultSourceInterface> source_;
212 std::unique_ptr<internal::ResultSourceInterface> source)
213 : source_(std::move(source)) {}
225 std::int64_t RowsModified()
const;
233 optional<std::unordered_map<std::string, std::string>> ExecutionStats()
const;
241 std::unique_ptr<internal::ResultSourceInterface> source_;
248 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_RESULTS_H
Represents the result and profile stats of a data modifying operation using spanner::Client::ProfileD...
::google::spanner::v1::QueryPlan ExecutionPlan
Contains a hierarchical representation of the operations the database server performs in order to exe...
RowStreamIterator end()
Returns a RowStreamIterator defining the end of this range.
Represents the stream of Rows and profile stats returned from spanner::Client::ProfileQuery().
ProfileDmlResult(std::unique_ptr< internal::ResultSourceInterface > source)
RowStreamIterator begin()
Returns a RowStreamIterator defining the beginning of this result set.
RowStream(std::unique_ptr< internal::ResultSourceInterface > source)
A RowStreamIterator is an Input Iterator (see below) that returns a sequence of StatusOr<Row> objects...
RowStreamIterator end()
Returns a RowStreamIterator defining the end of this result set.
Contains all the Cloud Spanner C++ client types and functions.
RowStreamIterator begin()
Returns a RowStreamIterator defining the beginning of this range.
ProfileQueryResult(std::unique_ptr< internal::ResultSourceInterface > source)
#define SPANNER_CLIENT_NS
Represents the result of a data modifying operation using spanner::Client::ExecuteDml().
DmlResult(std::unique_ptr< internal::ResultSourceInterface > source)
Represents the stream of Rows returned from spanner::Client::Read() or spanner::Client::ExecuteQuery(...