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 webpage provides documentation for the \u003ccode\u003eMutation\u003c/code\u003e class within the Google Cloud Spanner C++ library, specifically detailing its use in the mutation API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMutation\u003c/code\u003e class allows for data modification descriptions using data structures, as opposed to SQL statements, and is created via builders like \u003ccode\u003eInsertMutationBuilder\u003c/code\u003e or \u003ccode\u003eUpdateMutationBuilder\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation lists various versions of the \u003ccode\u003eMutation\u003c/code\u003e class, ranging from 2.11.0 up to the latest release candidate 2.37.0-rc, as well as defining methods to help with its usage.\u003c/p\u003e\n"],["\u003cp\u003eThe page explains that empty \u003ccode\u003eMutation\u003c/code\u003e objects are not usable with the Cloud Spanner mutation API and provides details on constructors and operators such as \u003ccode\u003eoperator=\u003c/code\u003e for move and copy assignments.\u003c/p\u003e\n"],["\u003cp\u003eIt also includes information on the \u003ccode\u003eas_proto()\u003c/code\u003e function, which facilitates the conversion of the \u003ccode\u003eMutation\u003c/code\u003e object to the underlying protocol buffer type \u003ccode\u003egoogle::spanner::v1::Mutation\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]