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 document outlines the Cloud Spanner Mutation API wrapper, which enables data modification using data structures instead of SQL.\u003c/p\u003e\n"],["\u003cp\u003eThe latest release candidate version is 2.37.0-rc, and the page also includes documentation for various previous versions, ranging from 2.11.0 to 2.36.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMutation\u003c/code\u003e class is a wrapper for all mutation types, and developers should utilize builders like \u003ccode\u003eInsertMutationBuilder\u003c/code\u003e or \u003ccode\u003eUpdateMutationBuilder\u003c/code\u003e to create instances.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMutation\u003c/code\u003e class offers methods to convert to the underlying proto, via the \u003ccode\u003eas_proto()\u003c/code\u003e method, and two constructors, one of which is able to create an empty mutation object, although unusable.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMutation\u003c/code\u003e class has override operators to move or copy the mutation, via \u003ccode\u003eoperator=(Mutation &&)\u003c/code\u003e and \u003ccode\u003eoperator=(Mutation const &)\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]