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 details the \u003ccode\u003eConnection\u003c/code\u003e interface for interacting with a Spanner database, defining pure-virtual methods corresponding to each user-facing method in the \u003ccode\u003eClient\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eConnection\u003c/code\u003e interface enables users to inject custom behavior, such as with a Google Mock object, into a \u003ccode\u003eClient\u003c/code\u003e object for testing purposes.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eConnection\u003c/code\u003e includes methods such as \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, all of which are virtual functions that forward to the specific Spanner \u003ccode\u003eClient\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMakeConnection()\u003c/code\u003e function is used to create a concrete instance of the \u003ccode\u003eConnection\u003c/code\u003e interface, allowing connection to a live Spanner database.\u003c/p\u003e\n"],["\u003cp\u003eThe provided content displays the historical log of versions for the \u003ccode\u003eclassgoogle_1_1cloud_1_1spanner_1_1Connection\u003c/code\u003e, with the most current release being [2.37.0-rc].\u003c/p\u003e\n"]]],[],null,[]]