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 various versions of the `Connection` class within the Google Cloud Spanner C++ client library, with the latest release being version 2.37.0-rc."],["The `Connection` class serves as an interface to a Spanner database instance, defining pure-virtual methods corresponding to the user-facing overloads in the `Client` class, facilitating custom behavior injection for testing."],["The `Connection` interface includes methods like `Read`, `PartitionRead`, `ExecuteQuery`, `ExecuteDml`, `Commit`, and `Rollback`, and it also supports operations such as partitioning, profiling, and analyzing queries."],["Users can create a tangible `Connection` to a real Spanner database using the `MakeConnection()` function, as opposed to creating a mocked object for testing."],["The virtual `options()` method returns the options used by the connection."]]],[]]