- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- Try it!
Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the database. If the named database does not exist, returns NOT_FOUND
.
While the operation is pending:
- The database's
reconcilingfield is set to true. - Cancelling the operation is best-effort. If the cancellation succeeds, the operation metadata's
cancelTimeis set, the updates are reverted, and the operation terminates with aCANCELLEDstatus. - New databases.patch requests will return a
FAILED_PRECONDITIONerror until the pending operation is done (returns successfully or with error). - Reading the database via the API continues to give the pre-request values.
Upon completion of the returned operation:
- The new values are in effect and readable via the API.
- The database's
reconcilingfield becomes false.
The returned long-running operation will have a name of the format projects/<project>/instances/<instance>/databases/<database>/operations/<operationId>
and can be used to track the database modification. The metadata field type is UpdateDatabaseMetadata
. The response field type is Database
, if successful.
HTTP request
The URLs use gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
database.name
|
Required. The name of the database. Values are of the form |
Query parameters
| Parameters | |
|---|---|
updateMask
|
Required. The list of fields to update. Currently, only This is a comma-separated list of fully qualified names of fields. Example: |
Request body
The request body contains an instance of Database
.
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires one of the following OAuth scopes:
-
https://www.googleapis.com/auth/spanner.admin -
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview .

