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"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-22 UTC."],[[["\u003cp\u003eThis page provides documentation for various versions of the \u003ccode\u003eConnection\u003c/code\u003e class within the Google Cloud Spanner C++ client library, with the latest release being version 2.37.0-rc.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eConnection\u003c/code\u003e class serves as an interface to a Spanner database instance, defining pure-virtual methods corresponding to the user-facing overloads in the \u003ccode\u003eClient\u003c/code\u003e class, facilitating custom behavior injection for testing.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eConnection\u003c/code\u003e interface includes methods like \u003ccode\u003eRead\u003c/code\u003e, \u003ccode\u003ePartitionRead\u003c/code\u003e, \u003ccode\u003eExecuteQuery\u003c/code\u003e, \u003ccode\u003eExecuteDml\u003c/code\u003e, \u003ccode\u003eCommit\u003c/code\u003e, and \u003ccode\u003eRollback\u003c/code\u003e, and it also supports operations such as partitioning, profiling, and analyzing queries.\u003c/p\u003e\n"],["\u003cp\u003eUsers can create a tangible \u003ccode\u003eConnection\u003c/code\u003e to a real Spanner database using the \u003ccode\u003eMakeConnection()\u003c/code\u003e function, as opposed to creating a mocked object for testing.\u003c/p\u003e\n"],["\u003cp\u003eThe virtual \u003ccode\u003eoptions()\u003c/code\u003e method returns the options used by the connection.\u003c/p\u003e\n"]]],[],null,[]]