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-04-09 UTC."],[[["This page provides documentation for the `Connection` class in the Google Cloud Spanner C++ library, detailing its role as a core interface for database interactions."],["The `Connection` interface defines pure-virtual methods that mirror the user-facing overload sets in the `Client` class, enabling custom behavior injection and testing through methods like `Read()`, `ExecuteQuery()`, and `Commit()`."],["The document provides details about different available versions, with the latest release candidate being 2.37.0-rc and previous releases like 2.29.0 all the way back to version 2.11.0."],["The `MakeConnection()` function, which can be found elsewhere, is used to create a real connection to the Spanner database."],["Each of the virtual functions, such as `Read()`, `PartitionRead()`, `ExecuteQuery()`, etc, correspond to client functions and have defined parameters, types and descriptions of returned data."]]],[]]