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().
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-21 UTC."],[[["This page provides documentation for the `Connection` interface in the Google Cloud Spanner C++ library, specifically for version 2.21.0, and includes links to documentation for other versions ranging from 2.11.0 to 2.37.0-rc."],["The `Connection` interface defines pure-virtual methods that correspond to each user-facing method in the `Client` class, such as `Read()`, `ExecuteQuery()`, and `Commit()`, enabling users to inject custom behavior for testing."],["`Connection` serves as an abstraction layer for interacting with a Spanner database, and a concrete connection can be created using `MakeConnection()`."],["The page details the various virtual functions within the `Connection` interface, including their parameters, return types, and how they relate to corresponding methods in the `Client` class."],["Each of these functions represents an operation available to perform on the database such as `Read`, `ExecuteQuery`, `Commit`, `Rollback`, and `BatchWrite`."]]],[]]