Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a name of the format <database_name>/operations/<operationId> and can be used to track execution of the schema changes. The metadata field type is UpdateDatabaseDdlMetadata. The operation has no response.
Required. DDL statements to be applied to the database.
operationId
string
If empty, the new update request is assigned an automatically-generated operation ID. Otherwise, operationId is used to construct the name of the resulting Operation.
Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the databases.updateDdl call is replayed, or the return value is otherwise lost: the database and operationId fields can be combined to form the name of the resulting longrunning.Operation: <database>/operations/<operationId>.
operationId should be unique within the database, and must be a valid identifier: [a-z][a-z0-9_]*. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, databases.updateDdl returns ALREADY_EXISTS.
Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. Contains a protobuf-serialized google.protobuf.FileDescriptorSet. To generate it, install and run protoc with --include_imports and --descriptor_set_out. For example, to generate for moon/shot/app.proto, run
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-23 UTC."],[],[],null,["# Method: projects.instances.databases.updateDdl\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUpdates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a name of the format `\u003cdatabase_name\u003e/operations/\u003coperationId\u003e` and can be used to track execution of the schema changes. The metadata field type is [UpdateDatabaseDdlMetadata](/spanner/docs/reference/rest/v1/UpdateDatabaseDdlMetadata). The operation has no response.\n\n### HTTP request\n\nChoose a location: \nglobal europe-west8 me-central2 us-central1 us-central2 us-east1 us-east4 us-east5 us-south1 us-west1 us-west2 us-west3 us-west4 us-west8 us-east7 \n\n\u003cbr /\u003e\n\nThe URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/spanner/docs/reference/rest/v1/projects.instanceConfigs.operations#Operation).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/spanner.admin`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]