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_mocks::MockResultSetSource Class Referenceabstract

Mock the results of a ExecuteQuery() or Read() operation. More...

#include <google/cloud/spanner/mocks/mock_spanner_connection.h>

Public Member Functions

 MOCK_METHOD (StatusOr< spanner::Row >, NextRow,(),(override))
 
 MOCK_METHOD (absl::optional< google::spanner::v1::ResultSetMetadata >, Metadata,(),(override))
 
 MOCK_METHOD (absl::optional< google::spanner::v1::ResultSetStats >, Stats,(),(const, override))
 
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

Mock the results of a ExecuteQuery() or Read() operation.

See also
Mocking the Cloud Spanner C++ Client with Google Mock for an example using this class.

Member Function Documentation

◆ Metadata()

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

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.

◆ MOCK_METHOD() [1/3]

google::cloud::spanner_mocks::MockResultSetSource::MOCK_METHOD ( absl::optional< google::spanner::v1::ResultSetMetadata >  ,
Metadata  ,
()  ,
(override)   
)

◆ MOCK_METHOD() [2/3]

google::cloud::spanner_mocks::MockResultSetSource::MOCK_METHOD ( absl::optional< google::spanner::v1::ResultSetStats >  ,
Stats  ,
()  ,
(const, override)   
)

◆ MOCK_METHOD() [3/3]

google::cloud::spanner_mocks::MockResultSetSource::MOCK_METHOD ( StatusOr< spanner::Row ,
NextRow  ,
()  ,
(override)   
)

◆ NextRow()

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

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 virtualinherited

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.