Class UpdateDatabaseDdlRequest.Builder (6.74.0)

public static final class UpdateDatabaseDdlRequest.Builder extends GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder> implements UpdateDatabaseDdlRequestOrBuilder

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.

Protobuf type google.spanner.admin.database.v1.UpdateDatabaseDdlRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllStatements(Iterable<String> values)

public UpdateDatabaseDdlRequest.Builder addAllStatements(Iterable<String> values)

Required. DDL statements to be applied to the database.

repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<String>

The statements to add.

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public UpdateDatabaseDdlRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides

addStatements(String value)

public UpdateDatabaseDdlRequest.Builder addStatements(String value)

Required. DDL statements to be applied to the database.

repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The statements to add.

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

addStatementsBytes(ByteString value)

public UpdateDatabaseDdlRequest.Builder addStatementsBytes(ByteString value)

Required. DDL statements to be applied to the database.

repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes of the statements to add.

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

build()

public UpdateDatabaseDdlRequest build()
Returns
Type Description
UpdateDatabaseDdlRequest

buildPartial()

public UpdateDatabaseDdlRequest buildPartial()
Returns
Type Description
UpdateDatabaseDdlRequest

clear()

public UpdateDatabaseDdlRequest.Builder clear()
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides

clearDatabase()

public UpdateDatabaseDdlRequest.Builder clearDatabase()

Required. The database to update.

string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public UpdateDatabaseDdlRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public UpdateDatabaseDdlRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides

clearOperationId()

public UpdateDatabaseDdlRequest.Builder clearOperationId()

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*. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, UpdateDatabaseDdl returns ALREADY_EXISTS.

string operation_id = 3;

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

clearProtoDescriptors()

public UpdateDatabaseDdlRequest.Builder clearProtoDescriptors()

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 <code><code> $protoc --proto_path=/app_path --proto_path=/lib_path &#92; --include_imports &#92; --descriptor_set_out=descriptors.data &#92; moon/shot/app.proto </code></code> For more details, see protobuffer self description.

bytes proto_descriptors = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

clearStatements()

public UpdateDatabaseDdlRequest.Builder clearStatements()

Required. DDL statements to be applied to the database.

repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

clone()

public UpdateDatabaseDdlRequest.Builder clone()
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides

getDatabase()

public String getDatabase()

Required. The database to update.

string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The database.

getDatabaseBytes()

public ByteString getDatabaseBytes()

Required. The database to update.

string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for database.

getDefaultInstanceForType()

public UpdateDatabaseDdlRequest getDefaultInstanceForType()
Returns
Type Description
UpdateDatabaseDdlRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getOperationId()

public String 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*. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, UpdateDatabaseDdl returns ALREADY_EXISTS.

string operation_id = 3;

Returns
Type Description
String

The operationId.

getOperationIdBytes()

public ByteString getOperationIdBytes()

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*. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, UpdateDatabaseDdl returns ALREADY_EXISTS.

string operation_id = 3;

Returns
Type Description
ByteString

The bytes for operationId.

getProtoDescriptors()

public ByteString 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 <code><code> $protoc --proto_path=/app_path --proto_path=/lib_path &#92; --include_imports &#92; --descriptor_set_out=descriptors.data &#92; moon/shot/app.proto </code></code> For more details, see protobuffer self description.

bytes proto_descriptors = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The protoDescriptors.

getStatements(int index)

public String getStatements(int index)

Required. DDL statements to be applied to the database.

repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The statements at the given index.

getStatementsBytes(int index)

public ByteString getStatementsBytes(int index)

Required. DDL statements to be applied to the database.

repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the statements at the given index.

getStatementsCount()

public int getStatementsCount()

Required. DDL statements to be applied to the database.

repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The count of statements.

getStatementsList()

public ProtocolStringList getStatementsList()

Required. DDL statements to be applied to the database.

repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ProtocolStringList

A list containing the statements.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public UpdateDatabaseDdlRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public UpdateDatabaseDdlRequest.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides

mergeFrom(UpdateDatabaseDdlRequest other)

public UpdateDatabaseDdlRequest.Builder mergeFrom(UpdateDatabaseDdlRequest other)
Parameter
Name Description
other UpdateDatabaseDdlRequest
Returns
Type Description
UpdateDatabaseDdlRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final UpdateDatabaseDdlRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides

setDatabase(String value)

public UpdateDatabaseDdlRequest.Builder setDatabase(String value)

Required. The database to update.

string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The database to set.

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

setDatabaseBytes(ByteString value)

public UpdateDatabaseDdlRequest.Builder setDatabaseBytes(ByteString value)

Required. The database to update.

string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for database to set.

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public UpdateDatabaseDdlRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides

setOperationId(String value)

public UpdateDatabaseDdlRequest.Builder setOperationId(String value)

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*. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, UpdateDatabaseDdl returns ALREADY_EXISTS.

string operation_id = 3;

Parameter
Name Description
value String

The operationId to set.

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

setOperationIdBytes(ByteString value)

public UpdateDatabaseDdlRequest.Builder setOperationIdBytes(ByteString value)

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*. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, UpdateDatabaseDdl returns ALREADY_EXISTS.

string operation_id = 3;

Parameter
Name Description
value ByteString

The bytes for operationId to set.

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

setProtoDescriptors(ByteString value)

public UpdateDatabaseDdlRequest.Builder setProtoDescriptors(ByteString value)

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 <code><code> $protoc --proto_path=/app_path --proto_path=/lib_path &#92; --include_imports &#92; --descriptor_set_out=descriptors.data &#92; moon/shot/app.proto </code></code> For more details, see protobuffer self description.

bytes proto_descriptors = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The protoDescriptors to set.

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public UpdateDatabaseDdlRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides

setStatements(int index, String value)

public UpdateDatabaseDdlRequest.Builder setStatements(int index, String value)

Required. DDL statements to be applied to the database.

repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int

The index to set the value at.

value String

The statements to set.

Returns
Type Description
UpdateDatabaseDdlRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final UpdateDatabaseDdlRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
UpdateDatabaseDdlRequest.Builder
Overrides