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 for C++, allowing data modification through a data structure rather than SQL statements.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the API documented is 2.37.0-rc, with a history of versions available, ranging from 2.36.0 down to 2.11.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMutation\u003c/code\u003e class provides constructors for creating empty mutations or moving/copying existing ones, along with overloaded assignment operators.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eas_proto()\u003c/code\u003e functions allow conversion of the mutation to its underlying \u003ccode\u003egoogle::spanner::v1::Mutation\u003c/code\u003e protocol buffer representation.\u003c/p\u003e\n"],["\u003cp\u003eBuilders such as \u003ccode\u003eInsertMutationBuilder\u003c/code\u003e and \u003ccode\u003eUpdateMutationBuilder\u003c/code\u003e should be used to create the \u003ccode\u003eMutation\u003c/code\u003e class objects for use in the Cloud Spanner mutation API.\u003c/p\u003e\n"]]],[],null,[]]