Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit 8c1ef9d

Browse files
authored
docs: add summary of result classes (#1243)
1 parent d1916ee commit 8c1ef9d

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

google/cloud/spanner/results.h

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ class RowStream {
9898
* This class encapsulates the result of a Cloud Spanner DML operation, i.e.,
9999
* `INSERT`, `UPDATE`, or `DELETE`.
100100
*
101-
* @note `ExecuteDmlResult` returns the number of rows modified, query plan
102-
* (if requested), and execution statistics (if requested).
101+
* @note `ExecuteDmlResult` returns the number of rows modified.
103102
*/
104103
class DmlResult {
105104
public:
@@ -123,6 +122,21 @@ class DmlResult {
123122
std::unique_ptr<internal::ResultSourceInterface> source_;
124123
};
125124

125+
/**
126+
* Represents the stream of `Rows` and profile stats returned from
127+
* `spanner::Client::ProfileQuery()`.
128+
*
129+
* A `RowStream` object is a range defined by the [Input
130+
* Iterators][input-iterator] returned from its `begin()` and `end()` members.
131+
* Callers may directly iterate a `RowStream` instance, which will return a
132+
* sequence of `StatusOr<Row>` objects.
133+
*
134+
* For convenience, callers may wrap a `RowStream` instance in a
135+
* `StreamOf<std::tuple<...>>` object, which will automatically parse each
136+
* `Row` into a `std::tuple` with the specified types.
137+
*
138+
* [input-iterator]: https://en.cppreference.com/w/cpp/named_req/InputIterator
139+
*/
126140
class ProfileQueryResult {
127141
public:
128142
ProfileQueryResult() = default;
@@ -167,6 +181,16 @@ class ProfileQueryResult {
167181
std::unique_ptr<internal::ResultSourceInterface> source_;
168182
};
169183

184+
/**
185+
* Represents the result and profile stats of a data modifying operation using
186+
* `spanner::Client::ProfileDml()`.
187+
*
188+
* This class encapsulates the result of a Cloud Spanner DML operation, i.e.,
189+
* `INSERT`, `UPDATE`, or `DELETE`.
190+
*
191+
* @note `ProfileDmlResult` returns the number of rows modified, execution
192+
* statistics, and query plan.
193+
*/
170194
class ProfileDmlResult {
171195
public:
172196
ProfileDmlResult() = default;

0 commit comments

Comments
 (0)