15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_RESULTS_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_RESULTS_H
18#include "google/cloud/spanner/row.h"
19#include "google/cloud/spanner/timestamp.h"
20#include "google/cloud/spanner/version.h"
21#include "google/cloud/optional.h"
22#include "absl/types/optional.h"
23#include <google/spanner/v1/spanner.pb.h>
26#include <unordered_map>
31GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
34
35
36
37
38
39
40
41
47
48
49
50
51
52
53
57
58
59
60
61
62
63 virtual absl::optional<
google::spanner::v1::ResultSetMetadata>
Metadata() = 0;
66
67
68
69
70
71
72 virtual absl::optional<
google::spanner::v1::ResultSetStats>
Stats()
const = 0;
76
77
78
79
80
81
82
83
84using ExecutionPlan = ::
google::spanner::v1::QueryPlan;
87
88
89
90
91
92
93
94
95
96
97
98
99
100
105 : source_(std::move(source)) {}
124
125
126
127
135
136
137
138
139
140
141
142
143
144
145
150 : source_(std::move(source)) {}
157
158
159
160
161
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
190 : source_(std::move(source)) {}
206
207
208
209
213
214
215
216
217
218
219 absl::optional<std::unordered_map<std::string, std::string>>
ExecutionStats()
223
224
225 absl::optional<
spanner::ExecutionPlan> ExecutionPlan()
const;
232
233
234
235
236
237
238
239
240
241
242
243
248 : source_(std::move(source)) {}
255
256
257
258
259
263
264
265
266
267
268 absl::optional<std::unordered_map<std::string, std::string>>
ExecutionStats()
272
273
274 absl::optional<
spanner::ExecutionPlan> ExecutionPlan()
const;
280GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
283namespace spanner_internal {
284GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
289GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Represents the result of a data modifying operation using spanner::Client::ExecuteDml().
Definition: results.h:146
DmlResult(DmlResult &&)=default
DmlResult & operator=(DmlResult &&)=default
std::int64_t RowsModified() const
Returns the number of rows modified by the DML statement.
DmlResult(std::unique_ptr< ResultSourceInterface > source)
Definition: results.h:149
Represents the result and profile stats of a data modifying operation using spanner::Client::ProfileD...
Definition: results.h:244
ProfileDmlResult()=default
absl::optional< std::unordered_map< std::string, std::string > > ExecutionStats() const
Returns a collection of key value pair statistics for the SQL statement execution.
std::int64_t RowsModified() const
Returns the number of rows modified by the DML statement.
ProfileDmlResult & operator=(ProfileDmlResult &&)=default
ProfileDmlResult(std::unique_ptr< ResultSourceInterface > source)
Definition: results.h:247
ProfileDmlResult(ProfileDmlResult &&)=default
Represents the stream of Rows and profile stats returned from spanner::Client::ProfileQuery().
Definition: results.h:186
ProfileQueryResult(std::unique_ptr< ResultSourceInterface > source)
Definition: results.h:189
RowStreamIterator end()
Returns a RowStreamIterator defining the end of this result set.
Definition: results.h:203
ProfileQueryResult(ProfileQueryResult &&)=default
absl::optional< Timestamp > ReadTimestamp() const
Retrieves the timestamp at which the read occurred.
ProfileQueryResult()=default
RowStreamIterator begin()
Returns a RowStreamIterator defining the beginning of this result set.
Definition: results.h:197
ProfileQueryResult & operator=(ProfileQueryResult &&)=default
absl::optional< std::unordered_map< std::string, std::string > > ExecutionStats() const
Returns a collection of key value pair statistics for the SQL statement execution.
Defines the interface for RowStream implementations.
Definition: results.h:42
virtual absl::optional< google::spanner::v1::ResultSetStats > Stats() const =0
Returns statistics about the result set, such as the number of rows, and the query plan used to compu...
virtual StatusOr< spanner::Row > NextRow()=0
Returns the next row in the stream.
virtual ~ResultSourceInterface()=default
virtual absl::optional< google::spanner::v1::ResultSetMetadata > Metadata()=0
Returns metadata about the result set, such as the field types and the transaction id created by the ...
A RowStreamIterator is an Input Iterator (see below) that returns a sequence of StatusOr<Row> objects...
Definition: row.h:251
RowStreamIterator()
Default constructs an "end" iterator.
RowStreamIterator(Source source)
Constructs a RowStreamIterator that will consume rows from the given source, which must not be nullpt...
Represents the stream of Rows returned from spanner::Client::Read() or spanner::Client::ExecuteQuery(...
Definition: results.h:101
RowStream & operator=(RowStream &&)=default
RowStreamIterator begin()
Returns a RowStreamIterator defining the beginning of this range.
Definition: results.h:112
absl::optional< Timestamp > ReadTimestamp() const
Retrieves the timestamp at which the read occurred.
RowStream(std::unique_ptr< ResultSourceInterface > source)
Definition: results.h:104
std::int64_t RowsModified() const
Returns the number of rows modified by a DML statement.
RowStream(RowStream &&)=default
RowStreamIterator end()
Returns a RowStreamIterator defining the end of this range.
Definition: results.h:118
A Row is a sequence of columns each with a name and an associated Value.
Definition: row.h:84
A representation of the Spanner TIMESTAMP type: An instant in time.
Definition: timestamp.h:54
Contains all the Cloud Spanner C++ client types and functions.
Definition: backoff_policy.h:23