Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
Public Member Functions | List of all members
google::cloud::spanner::ResultSourceInterface Class Referenceabstract

Defines the interface for RowStream implementations. More...

#include <google/cloud/spanner/results.h>

Public Member Functions

virtual ~ResultSourceInterface ()=default
 
virtual StatusOr< spanner::RowNextRow ()=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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~ResultSourceInterface()

virtual google::cloud::spanner::ResultSourceInterface::~ResultSourceInterface ( )
virtualdefault

Member Function Documentation

◆ Metadata()

virtual absl::optional< google::spanner::v1::ResultSetMetadata > google::cloud::spanner::ResultSourceInterface::Metadata ( )
pure virtual

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

See also
https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#resultsetmetadata for more information.

◆ NextRow()

virtual StatusOr< spanner::Row > google::cloud::spanner::ResultSourceInterface::NextRow ( )
pure virtual

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

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

See also
https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#resultsetstats for more information.