Class ResultSourceInterface (2.32.0-rc)

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.

Functions

NextRow()

Returns the next row in the stream.

Returns
Type Description
StatusOr< spanner::Row >

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.

Metadata()

Returns metadata about the result set, such as the field types and the transaction id created by the request.

Returns
Type Description
absl::optional< google::spanner::v1::ResultSetMetadata >

Stats() const

Returns statistics about the result set, such as the number of rows, and the query plan used to compute the results.

Returns
Type Description
absl::optional< google::spanner::v1::ResultSetStats >