In addition to the Data Manipulation Language (DML) based APIs, Cloud Spanner supports the mutation API, where the application describes data modification using a data structure instead of a SQL statement.
This class serves as a wrapper for all mutations types. Use the builders, such as InsertMutationBuilder or UpdateMutationBuilder to create objects of this class.
[[["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 the \u003ccode\u003eMutation\u003c/code\u003e class in the Cloud Spanner C++ library, serving as a wrapper for all mutation types within the Cloud Spanner mutation API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMutation\u003c/code\u003e class allows applications to describe data modifications using a data structure, which acts as an alternative to SQL statements with the Data Manipulation Language (DML) API.\u003c/p\u003e\n"],["\u003cp\u003eYou can use \u003ccode\u003eInsertMutationBuilder\u003c/code\u003e or \u003ccode\u003eUpdateMutationBuilder\u003c/code\u003e to create objects of this \u003ccode\u003eMutation\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation includes various versions of the \u003ccode\u003eMutation\u003c/code\u003e class, from version 2.11.0 up to the latest release candidate, 2.37.0-rc, with each version linking to their specific class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMutation\u003c/code\u003e class includes constructors, move and copy operators, as well as the \u003ccode\u003eas_proto()\u003c/code\u003e function for converting the mutation to the underlying proto.\u003c/p\u003e\n"]]],[],null,[]]