Google Cloud Spanner C++ Client  2.4.0
A C++ Client Library for Google Cloud Spanner
Classes | Functions
google::cloud::spanner_mocks Namespace Reference

Define classes to mock the Cloud Spanner C++ client APIs. More...

Classes

class  MockDatabaseAdminConnection
 A class to mock google::cloud::spanner::DatabaseAdminConnection. More...
 
class  MockInstanceAdminConnection
 A class to mock google::cloud::spanner::InstanceAdminConnection. More...
 
class  MockConnection
 An inlined versioned namespace to avoid dependency diamonds. More...
 
class  MockResultSetSource
 Mock the results of a ExecuteQuery() or Read() operation. More...
 

Functions

spanner::Row MakeRow (std::vector< std::pair< std::string, spanner::Value >> pairs)
 Creates a spanner::Row with the specified column names and values. More...
 
template<typename... Ts>
spanner::Row MakeRow (Ts &&... ts)
 Creates a spanner::Row with spanner::Values created from the given arguments and with auto-generated column names. More...
 

Detailed Description

Define classes to mock the Cloud Spanner C++ client APIs.

Function Documentation

◆ MakeRow() [1/2]

spanner::Row google::cloud::spanner_mocks::MakeRow ( std::vector< std::pair< std::string, spanner::Value >>  pairs)
inline

Creates a spanner::Row with the specified column names and values.

This overload accepts a vector of pairs, allowing the caller to specify both the column names and the spanner::Value that goes in each column.

This function is intended for application developers who are mocking the results of a Client::ExecuteQuery call.

Definition at line 42 of file row.h.

◆ MakeRow() [2/2]

template<typename... Ts>
spanner::Row google::cloud::spanner_mocks::MakeRow ( Ts &&...  ts)

Creates a spanner::Row with spanner::Values created from the given arguments and with auto-generated column names.

This overload accepts a variadic list of arguments that will be used to create the spanner::Values in the row. The column names will be implicitly generated, the first column being "0", the second "1", and so on, corresponding to the argument's position.

This function is intended for application developers who are mocking the results of a Client::ExecuteQuery call.

Definition at line 60 of file row.h.