Reference documentation and code samples for the Cloud Spanner V1 Client class UpdateDatabaseDdlRequest.
Enqueues the given DDL statements to be applied, in order but not
necessarily all at once, to the database schema at some point (or
points) in the future. The server checks that the statements
are executable (syntactically valid, name tables that exist, etc.)
before enqueueing them, but they may still fail upon
later execution (e.g., if a statement from another batch of
statements is applied first and it conflicts in some way, or if
there is some data-related problem like a NULL value in a column to
which NOT NULL would be added). If a statement fails, all
subsequent statements in the batch are automatically cancelled.
Each batch of statements is assigned a name which can be used with
the Operations API to monitor
progress. See the
operation_id
field for more details.
Generated from protobuf message google.spanner.admin.database.v1.UpdateDatabaseDdlRequest
Namespace
Google \ Cloud \ Spanner \ Admin \ Database \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ database
string
Required. The database to update.
↳ statements
array
Required. DDL statements to be applied to the database.
↳ operation_id
string
If empty, the new update request is assigned an automatically-generated operation ID. Otherwise, operation_id 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 UpdateDatabaseDdl call is replayed, or the return value is otherwise lost: the database and operation_id fields can be combined to form the name of the resulting longrunning.Operation: <database>/operations/<operation_id>. operation_id 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, UpdateDatabaseDdl returns ALREADY_EXISTS.
↳ proto_descriptors
string
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 $protoc --proto_path=/app_path --proto_path=/lib_path \ --include_imports \ --descriptor_set_out=descriptors.data \ moon/shot/app.proto For more details, see protobuffer self description.
↳ throughput_mode
bool
Optional. This field is exposed to be used by the Spanner Migration Tool. For more details, see SMT.
getDatabase
Required. The database to update.
Returns
Type
Description
string
setDatabase
Required. The database to update.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getStatements
Required. DDL statements to be applied to the database.
Required. DDL statements to be applied to the database.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getOperationId
If empty, the new update request is assigned an
automatically-generated operation ID. Otherwise, operation_id
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
UpdateDatabaseDdl
call is replayed, or the return value is otherwise lost: the
database
and operation_id fields can be combined to form the
name of the resulting
longrunning.Operation:
<database>/operations/<operation_id>.
operation_id 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,
UpdateDatabaseDdl
returns ALREADY_EXISTS.
Returns
Type
Description
string
setOperationId
If empty, the new update request is assigned an
automatically-generated operation ID. Otherwise, operation_id
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
UpdateDatabaseDdl
call is replayed, or the return value is otherwise lost: the
database
and operation_id fields can be combined to form the
name of the resulting
longrunning.Operation:
<database>/operations/<operation_id>.
operation_id 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,
UpdateDatabaseDdl
returns ALREADY_EXISTS.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getProtoDescriptors
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
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-09-04 UTC."],[],[],null,["# Cloud Spanner V1 Client - Class UpdateDatabaseDdlRequest (1.104.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.104.0 (latest)](/php/docs/reference/cloud-spanner/latest/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.103.0](/php/docs/reference/cloud-spanner/1.103.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.102.0](/php/docs/reference/cloud-spanner/1.102.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.101.0](/php/docs/reference/cloud-spanner/1.101.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.100.0](/php/docs/reference/cloud-spanner/1.100.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.98.0](/php/docs/reference/cloud-spanner/1.98.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.97.0](/php/docs/reference/cloud-spanner/1.97.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.96.0](/php/docs/reference/cloud-spanner/1.96.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.95.0](/php/docs/reference/cloud-spanner/1.95.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.94.0](/php/docs/reference/cloud-spanner/1.94.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.93.1](/php/docs/reference/cloud-spanner/1.93.1/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.92.1](/php/docs/reference/cloud-spanner/1.92.1/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.91.0](/php/docs/reference/cloud-spanner/1.91.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.90.0](/php/docs/reference/cloud-spanner/1.90.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.89.0](/php/docs/reference/cloud-spanner/1.89.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.88.0](/php/docs/reference/cloud-spanner/1.88.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.87.0](/php/docs/reference/cloud-spanner/1.87.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.86.0](/php/docs/reference/cloud-spanner/1.86.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.85.0](/php/docs/reference/cloud-spanner/1.85.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.84.0](/php/docs/reference/cloud-spanner/1.84.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.83.0](/php/docs/reference/cloud-spanner/1.83.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.82.0](/php/docs/reference/cloud-spanner/1.82.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.81.0](/php/docs/reference/cloud-spanner/1.81.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.80.0](/php/docs/reference/cloud-spanner/1.80.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.79.0](/php/docs/reference/cloud-spanner/1.79.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.78.0](/php/docs/reference/cloud-spanner/1.78.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.77.0](/php/docs/reference/cloud-spanner/1.77.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.76.1](/php/docs/reference/cloud-spanner/1.76.1/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.68.0](/php/docs/reference/cloud-spanner/1.68.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.67.0](/php/docs/reference/cloud-spanner/1.67.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.66.0](/php/docs/reference/cloud-spanner/1.66.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.65.0](/php/docs/reference/cloud-spanner/1.65.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.64.0](/php/docs/reference/cloud-spanner/1.64.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.63.2](/php/docs/reference/cloud-spanner/1.63.2/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.62.1](/php/docs/reference/cloud-spanner/1.62.1/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.61.0](/php/docs/reference/cloud-spanner/1.61.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.60.0](/php/docs/reference/cloud-spanner/1.60.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.59.0](/php/docs/reference/cloud-spanner/1.59.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.58.4](/php/docs/reference/cloud-spanner/1.58.4/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.57.0](/php/docs/reference/cloud-spanner/1.57.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.56.0](/php/docs/reference/cloud-spanner/1.56.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.55.0](/php/docs/reference/cloud-spanner/1.55.0/Admin.Database.V1.UpdateDatabaseDdlRequest)\n- [1.54.2](/php/docs/reference/cloud-spanner/1.54.2/Admin.Database.V1.UpdateDatabaseDdlRequest) \nReference documentation and code samples for the Cloud Spanner V1 Client class UpdateDatabaseDdlRequest.\n\nEnqueues the given DDL statements to be applied, in order but not\nnecessarily all at once, to the database schema at some point (or\npoints) in the future. The server checks that the statements\nare executable (syntactically valid, name tables that exist, etc.)\nbefore enqueueing them, but they may still fail upon\nlater execution (e.g., if a statement from another batch of\nstatements is applied first and it conflicts in some way, or if\nthere is some data-related problem like a `NULL` value in a column to\nwhich `NOT NULL` would be added). If a statement fails, all\nsubsequent statements in the batch are automatically cancelled.\n\nEach batch of statements is assigned a name which can be used with\nthe Operations API to monitor\nprogress. See the\n[operation_id](/php/docs/reference/cloud-spanner/latest/Admin.Database.V1.UpdateDatabaseDdlRequest#_Google_Cloud_Spanner_Admin_Database_V1_UpdateDatabaseDdlRequest__getOperationId__)\nfield for more details.\n\nGenerated from protobuf message `google.spanner.admin.database.v1.UpdateDatabaseDdlRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Spanner \\\\ Admin \\\\ Database \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getDatabase\n\nRequired. The database to update.\n\n### setDatabase\n\nRequired. The database to update.\n\n### getStatements\n\nRequired. DDL statements to be applied to the database.\n\n### setStatements\n\nRequired. DDL statements to be applied to the database.\n\n### getOperationId\n\nIf empty, the new update request is assigned an\nautomatically-generated operation ID. Otherwise, `operation_id`\nis used to construct the name of the resulting\nOperation.\n\nSpecifying an explicit operation ID simplifies determining\nwhether the statements were executed in the event that the\nUpdateDatabaseDdl\ncall is replayed, or the return value is otherwise lost: the\n[database](/php/docs/reference/cloud-spanner/latest/Admin.Database.V1.UpdateDatabaseDdlRequest#_Google_Cloud_Spanner_Admin_Database_V1_UpdateDatabaseDdlRequest__getDatabase__)\nand `operation_id` fields can be combined to form the\nname of the resulting\nlongrunning.Operation:\n`\u003cdatabase\u003e/operations/\u003coperation_id\u003e`.\n`operation_id` should be unique within the database, and must be\na valid identifier: `[a-z][a-z0-9_]*`. Note that\nautomatically-generated operation IDs always begin with an\nunderscore. If the named operation already exists,\nUpdateDatabaseDdl\nreturns `ALREADY_EXISTS`.\n\n### setOperationId\n\nIf empty, the new update request is assigned an\nautomatically-generated operation ID. Otherwise, `operation_id`\nis used to construct the name of the resulting\nOperation.\n\nSpecifying an explicit operation ID simplifies determining\nwhether the statements were executed in the event that the\nUpdateDatabaseDdl\ncall is replayed, or the return value is otherwise lost: the\n[database](/php/docs/reference/cloud-spanner/latest/Admin.Database.V1.UpdateDatabaseDdlRequest#_Google_Cloud_Spanner_Admin_Database_V1_UpdateDatabaseDdlRequest__getDatabase__)\nand `operation_id` fields can be combined to form the\nname of the resulting\nlongrunning.Operation:\n`\u003cdatabase\u003e/operations/\u003coperation_id\u003e`.\n`operation_id` should be unique within the database, and must be\na valid identifier: `[a-z][a-z0-9_]*`. Note that\nautomatically-generated operation IDs always begin with an\nunderscore. If the named operation already exists,\nUpdateDatabaseDdl\nreturns `ALREADY_EXISTS`.\n\n### getProtoDescriptors\n\nOptional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.\n\nContains a protobuf-serialized\n[google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).\nTo generate it, [install](https://grpc.io/docs/protoc-installation/) and\nrun `protoc` with --include_imports and --descriptor_set_out. For example,\nto generate for moon/shot/app.proto, run \n\n $protoc --proto_path=/app_path --proto_path=/lib_path \\\n --include_imports \\\n --descriptor_set_out=descriptors.data \\\n moon/shot/app.proto\n\nFor more details, see protobuffer [self\ndescription](https://developers.google.com/protocol-buffers/docs/techniques#self-description).\n\n### setProtoDescriptors\n\nOptional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.\n\nContains a protobuf-serialized\n[google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).\nTo generate it, [install](https://grpc.io/docs/protoc-installation/) and\nrun `protoc` with --include_imports and --descriptor_set_out. For example,\nto generate for moon/shot/app.proto, run \n\n $protoc --proto_path=/app_path --proto_path=/lib_path \\\n --include_imports \\\n --descriptor_set_out=descriptors.data \\\n moon/shot/app.proto\n\nFor more details, see protobuffer [self\ndescription](https://developers.google.com/protocol-buffers/docs/techniques#self-description).\n\n### getThroughputMode\n\nOptional. This field is exposed to be used by the Spanner Migration Tool.\n\nFor more details, see\n[SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool).\n\n### setThroughputMode\n\nOptional. This field is exposed to be used by the Spanner Migration Tool.\n\nFor more details, see\n[SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool).\n\n### static::build"]]