Google Cloud Spanner C++ Client  1.32.1
A C++ Client Library for Google Cloud Spanner
Classes | Public Member Functions | List of all members
google::cloud::spanner::v1::Connection Class Referenceabstract

A connection to a Spanner database instance. More...

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

Classes

struct  CommitParams
 Wrap the arguments to Commit(). More...
 
struct  ExecuteBatchDmlParams
 Wrap the arguments to ExecuteBatchDml(). More...
 
struct  ExecutePartitionedDmlParams
 Wrap the arguments to ExecutePartitionedDml(). More...
 
struct  PartitionQueryParams
 Wrap the arguments to PartitionQuery(). More...
 
struct  PartitionReadParams
 Wrap the arguments to PartitionRead(). More...
 
struct  ReadParams
 Wrap the arguments to Read(). More...
 
struct  RollbackParams
 Wrap the arguments to Rollback(). More...
 
struct  SqlParams
 Wrap the arguments to ExecuteQuery(), ExecuteDml(), ProfileQuery(), ProfileDml(), and AnalyzeSql(). More...
 

Public Member Functions

virtual ~Connection ()=default
 
Defines the arguments for each member function.

Applications may define classes derived from Connection, for example, because they want to mock the class.

To avoid breaking all such derived classes when we change the number or type of the arguments to the member functions we define light weight structures to pass the arguments.

virtual RowStream Read (ReadParams)=0
 Defines the interface for Client::Read() More...
 
virtual StatusOr< std::vector< ReadPartition > > PartitionRead (PartitionReadParams)=0
 Defines the interface for Client::PartitionRead() More...
 
virtual RowStream ExecuteQuery (SqlParams)=0
 Defines the interface for Client::ExecuteQuery() More...
 
virtual StatusOr< DmlResultExecuteDml (SqlParams)=0
 Defines the interface for Client::ExecuteDml() More...
 
virtual ProfileQueryResult ProfileQuery (SqlParams)=0
 Defines the interface for Client::ProfileQuery() More...
 
virtual StatusOr< ProfileDmlResultProfileDml (SqlParams)=0
 Defines the interface for Client::ProfileDml() More...
 
virtual StatusOr< ExecutionPlanAnalyzeSql (SqlParams)=0
 Defines the interface for Client::AnalyzeSql() More...
 
virtual StatusOr< PartitionedDmlResultExecutePartitionedDml (ExecutePartitionedDmlParams)=0
 Defines the interface for Client::ExecutePartitionedDml() More...
 
virtual StatusOr< std::vector< QueryPartition > > PartitionQuery (PartitionQueryParams)=0
 Defines the interface for Client::PartitionQuery() More...
 
virtual StatusOr< BatchDmlResultExecuteBatchDml (ExecuteBatchDmlParams)=0
 Defines the interface for Client::ExecuteBatchDml() More...
 
virtual StatusOr< CommitResultCommit (CommitParams)=0
 Defines the interface for Client::Commit() More...
 
virtual Status Rollback (RollbackParams)=0
 Defines the interface for Client::Rollback() More...
 

Detailed Description

A connection to a Spanner database instance.

This interface defines pure-virtual methods for each of the user-facing overload sets in Client. That is, all of Client's Read() overloads will forward to the one pure-virtual Read() method declared in this interface, and similar for Client's other methods. This allows users to inject custom behavior (e.g., with a Google Mock object) in a Client object for use in their own tests.

To create a concrete instance that connects you to a real Spanner database, see MakeConnection().

Definition at line 59 of file connection.h.

Constructor & Destructor Documentation

◆ ~Connection()

virtual google::cloud::spanner::v1::Connection::~Connection ( )
virtualdefault

Member Function Documentation

◆ AnalyzeSql()

virtual StatusOr<ExecutionPlan> google::cloud::spanner::v1::Connection::AnalyzeSql ( SqlParams  )
pure virtual

Defines the interface for Client::AnalyzeSql()

◆ Commit()

virtual StatusOr<CommitResult> google::cloud::spanner::v1::Connection::Commit ( CommitParams  )
pure virtual

Defines the interface for Client::Commit()

◆ ExecuteBatchDml()

virtual StatusOr<BatchDmlResult> google::cloud::spanner::v1::Connection::ExecuteBatchDml ( ExecuteBatchDmlParams  )
pure virtual

Defines the interface for Client::ExecuteBatchDml()

◆ ExecuteDml()

virtual StatusOr<DmlResult> google::cloud::spanner::v1::Connection::ExecuteDml ( SqlParams  )
pure virtual

Defines the interface for Client::ExecuteDml()

◆ ExecutePartitionedDml()

virtual StatusOr<PartitionedDmlResult> google::cloud::spanner::v1::Connection::ExecutePartitionedDml ( ExecutePartitionedDmlParams  )
pure virtual

Defines the interface for Client::ExecutePartitionedDml()

◆ ExecuteQuery()

virtual RowStream google::cloud::spanner::v1::Connection::ExecuteQuery ( SqlParams  )
pure virtual

Defines the interface for Client::ExecuteQuery()

◆ PartitionQuery()

virtual StatusOr<std::vector<QueryPartition> > google::cloud::spanner::v1::Connection::PartitionQuery ( PartitionQueryParams  )
pure virtual

Defines the interface for Client::PartitionQuery()

◆ PartitionRead()

virtual StatusOr<std::vector<ReadPartition> > google::cloud::spanner::v1::Connection::PartitionRead ( PartitionReadParams  )
pure virtual

Defines the interface for Client::PartitionRead()

◆ ProfileDml()

virtual StatusOr<ProfileDmlResult> google::cloud::spanner::v1::Connection::ProfileDml ( SqlParams  )
pure virtual

Defines the interface for Client::ProfileDml()

◆ ProfileQuery()

virtual ProfileQueryResult google::cloud::spanner::v1::Connection::ProfileQuery ( SqlParams  )
pure virtual

Defines the interface for Client::ProfileQuery()

◆ Read()

virtual RowStream google::cloud::spanner::v1::Connection::Read ( ReadParams  )
pure virtual

Defines the interface for Client::Read()

◆ Rollback()

virtual Status google::cloud::spanner::v1::Connection::Rollback ( RollbackParams  )
pure virtual

Defines the interface for Client::Rollback()