Defines the interface for RowStream
implementations.
More...
#include <google/cloud/spanner/results.h>
|
virtual | ~ResultSourceInterface ()=default |
|
virtual StatusOr< spanner::Row > | NextRow ()=0 |
| Returns the next row in the stream. More...
|
|
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 request. More...
|
|
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 compute the results. More...
|
|
Defines the interface for RowStream
implementations.
The RowStream
class represents a stream of Rows
returned from spanner::Client::Read()
or spanner::Client::ExecuteQuery()
. There are different implementations depending the the RPC. Applications can also mock this class when testing their code and mocking the spanner::Client
behavior.
◆ ~ResultSourceInterface()
virtual google::cloud::spanner::ResultSourceInterface::~ResultSourceInterface |
( |
| ) |
|
|
virtualdefault |
◆ Metadata()
virtual absl::optional< google::spanner::v1::ResultSetMetadata > google::cloud::spanner::ResultSourceInterface::Metadata |
( |
| ) |
|
|
pure virtual |
◆ NextRow()
Returns the next row in the stream.
- Returns
- if the stream is interrupted due to a failure the
StatusOr<spanner::Row>
contains the error. The function returns a successful StatusOr<>
with an empty spanner::Row
to indicate end-of-stream.
◆ Stats()
virtual absl::optional< google::spanner::v1::ResultSetStats > google::cloud::spanner::ResultSourceInterface::Stats |
( |
| ) |
const |
|
pure virtual |