Reference documentation and code samples for the Cloud Spanner V1 Client class CreateDatabaseRequest.
The request for
CreateDatabase.
Generated from protobuf message google.spanner.admin.database.v1.CreateDatabaseRequest
Namespace
Google \ Cloud \ Spanner \ Admin \ Database \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ parent
string
Required. The name of the instance that will serve the new database. Values are of the form projects/<project>/instances/<instance>.
↳ create_statement
string
Required. A CREATE DATABASE statement, which specifies the ID of the new database. The database ID must conform to the regular expression [a-z][a-z0-9_\-]*[a-z0-9] and be between 2 and 30 characters in length. If the database ID is a reserved word or if it contains a hyphen, the database ID must be enclosed in backticks (` ).
↳ extra_statements
array
Optional. A list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: if there is an error in any statement, the database is not created.
Optional. The encryption configuration for the database. If this field is not specified, Cloud Spanner will encrypt/decrypt all data at rest using Google default encryption.
↳ database_dialect
int
Optional. The dialect of the Cloud Spanner Database.
↳ proto_descriptors
string
Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in 'extra_statements' above. 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.
getParent
Required. The name of the instance that will serve the new database.
Values are of the form projects/<project>/instances/<instance>.
Returns
Type
Description
string
setParent
Required. The name of the instance that will serve the new database.
Values are of the form projects/<project>/instances/<instance>.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getCreateStatement
Required. A CREATE DATABASE statement, which specifies the ID of the
new database. The database ID must conform to the regular expression
[a-z][a-z0-9_\-]*[a-z0-9] and be between 2 and 30 characters in length.
If the database ID is a reserved word or if it contains a hyphen, the
database ID must be enclosed in backticks (` ).
Returns
Type
Description
string
setCreateStatement
Required. A CREATE DATABASE statement, which specifies the ID of the
new database. The database ID must conform to the regular expression
[a-z][a-z0-9_\-]*[a-z0-9] and be between 2 and 30 characters in length.
If the database ID is a reserved word or if it contains a hyphen, the
database ID must be enclosed in backticks (` ).
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getExtraStatements
Optional. A list of DDL statements to run inside the newly created
database. Statements can create tables, indexes, etc. These
statements execute atomically with the creation of the database:
if there is an error in any statement, the database is not created.
Optional. A list of DDL statements to run inside the newly created
database. Statements can create tables, indexes, etc. These
statements execute atomically with the creation of the database:
if there is an error in any statement, the database is not created.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getEncryptionConfig
Optional. The encryption configuration for the database. If this field is
not specified, Cloud Spanner will encrypt/decrypt all data at rest using
Google default encryption.
Optional. The encryption configuration for the database. If this field is
not specified, Cloud Spanner will encrypt/decrypt all data at rest using
Google default encryption.
Optional. The dialect of the Cloud Spanner Database.
Returns
Type
Description
int
setDatabaseDialect
Optional. The dialect of the Cloud Spanner Database.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getProtoDescriptors
Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in
'extra_statements' above.
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 in
'extra_statements' above.
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
Required. The name of the instance that will serve the new database.
Values are of the form projects/<project>/instances/<instance>. Please see
DatabaseAdminClient::instanceName() for help formatting this field.
createStatement
string
Required. A CREATE DATABASE statement, which specifies the ID of the
new database. The database ID must conform to the regular expression
[a-z][a-z0-9_\-]*[a-z0-9] and be between 2 and 30 characters in length.
If the database ID is a reserved word or if it contains a hyphen, the
database ID must be enclosed in backticks (` ).
[[["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-07 UTC."],[],[],null,["# Cloud Spanner V1 Client - Class CreateDatabaseRequest (1.104.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.104.0 (latest)](/php/docs/reference/cloud-spanner/latest/Admin.Database.V1.CreateDatabaseRequest)\n- [1.103.0](/php/docs/reference/cloud-spanner/1.103.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.102.0](/php/docs/reference/cloud-spanner/1.102.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.101.0](/php/docs/reference/cloud-spanner/1.101.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.100.0](/php/docs/reference/cloud-spanner/1.100.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.98.0](/php/docs/reference/cloud-spanner/1.98.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.97.0](/php/docs/reference/cloud-spanner/1.97.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.96.0](/php/docs/reference/cloud-spanner/1.96.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.95.0](/php/docs/reference/cloud-spanner/1.95.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.94.0](/php/docs/reference/cloud-spanner/1.94.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.93.1](/php/docs/reference/cloud-spanner/1.93.1/Admin.Database.V1.CreateDatabaseRequest)\n- [1.92.1](/php/docs/reference/cloud-spanner/1.92.1/Admin.Database.V1.CreateDatabaseRequest)\n- [1.91.0](/php/docs/reference/cloud-spanner/1.91.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.90.0](/php/docs/reference/cloud-spanner/1.90.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.89.0](/php/docs/reference/cloud-spanner/1.89.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.88.0](/php/docs/reference/cloud-spanner/1.88.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.87.0](/php/docs/reference/cloud-spanner/1.87.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.86.0](/php/docs/reference/cloud-spanner/1.86.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.85.0](/php/docs/reference/cloud-spanner/1.85.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.84.0](/php/docs/reference/cloud-spanner/1.84.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.83.0](/php/docs/reference/cloud-spanner/1.83.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.82.0](/php/docs/reference/cloud-spanner/1.82.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.81.0](/php/docs/reference/cloud-spanner/1.81.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.80.0](/php/docs/reference/cloud-spanner/1.80.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.79.0](/php/docs/reference/cloud-spanner/1.79.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.78.0](/php/docs/reference/cloud-spanner/1.78.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.77.0](/php/docs/reference/cloud-spanner/1.77.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.76.1](/php/docs/reference/cloud-spanner/1.76.1/Admin.Database.V1.CreateDatabaseRequest)\n- [1.68.0](/php/docs/reference/cloud-spanner/1.68.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.67.0](/php/docs/reference/cloud-spanner/1.67.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.66.0](/php/docs/reference/cloud-spanner/1.66.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.65.0](/php/docs/reference/cloud-spanner/1.65.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.64.0](/php/docs/reference/cloud-spanner/1.64.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.63.2](/php/docs/reference/cloud-spanner/1.63.2/Admin.Database.V1.CreateDatabaseRequest)\n- [1.62.1](/php/docs/reference/cloud-spanner/1.62.1/Admin.Database.V1.CreateDatabaseRequest)\n- [1.61.0](/php/docs/reference/cloud-spanner/1.61.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.60.0](/php/docs/reference/cloud-spanner/1.60.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.59.0](/php/docs/reference/cloud-spanner/1.59.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.58.4](/php/docs/reference/cloud-spanner/1.58.4/Admin.Database.V1.CreateDatabaseRequest)\n- [1.57.0](/php/docs/reference/cloud-spanner/1.57.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.56.0](/php/docs/reference/cloud-spanner/1.56.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.55.0](/php/docs/reference/cloud-spanner/1.55.0/Admin.Database.V1.CreateDatabaseRequest)\n- [1.54.2](/php/docs/reference/cloud-spanner/1.54.2/Admin.Database.V1.CreateDatabaseRequest) \nReference documentation and code samples for the Cloud Spanner V1 Client class CreateDatabaseRequest.\n\nThe request for\nCreateDatabase.\n\nGenerated from protobuf message `google.spanner.admin.database.v1.CreateDatabaseRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Spanner \\\\ Admin \\\\ Database \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getParent\n\nRequired. The name of the instance that will serve the new database.\n\nValues are of the form `projects/\u003cproject\u003e/instances/\u003cinstance\u003e`.\n\n### setParent\n\nRequired. The name of the instance that will serve the new database.\n\nValues are of the form `projects/\u003cproject\u003e/instances/\u003cinstance\u003e`.\n\n### getCreateStatement\n\nRequired. A `CREATE DATABASE` statement, which specifies the ID of the\nnew database. The database ID must conform to the regular expression\n`[a-z][a-z0-9_\\-]*[a-z0-9]` and be between 2 and 30 characters in length.\n\nIf the database ID is a reserved word or if it contains a hyphen, the\ndatabase ID must be enclosed in backticks (``` ``).\n\n### setCreateStatement\n\nRequired. A `CREATE DATABASE` statement, which specifies the ID of the\nnew database. The database ID must conform to the regular expression\n`[a-z][a-z0-9_\\-]*[a-z0-9]` and be between 2 and 30 characters in length.\n\nIf the database ID is a reserved word or if it contains a hyphen, the\ndatabase ID must be enclosed in backticks (``` ``).\n\n### getExtraStatements\n\nOptional. A list of DDL statements to run inside the newly created\ndatabase. Statements can create tables, indexes, etc. These\nstatements execute atomically with the creation of the database:\nif there is an error in any statement, the database is not created.\n\n### setExtraStatements\n\nOptional. A list of DDL statements to run inside the newly created\ndatabase. Statements can create tables, indexes, etc. These\nstatements execute atomically with the creation of the database:\nif there is an error in any statement, the database is not created.\n\n### getEncryptionConfig\n\nOptional. The encryption configuration for the database. If this field is\nnot specified, Cloud Spanner will encrypt/decrypt all data at rest using\nGoogle default encryption.\n\n### hasEncryptionConfig\n\n### clearEncryptionConfig\n\n### setEncryptionConfig\n\nOptional. The encryption configuration for the database. If this field is\nnot specified, Cloud Spanner will encrypt/decrypt all data at rest using\nGoogle default encryption.\n\n### getDatabaseDialect\n\nOptional. The dialect of the Cloud Spanner Database.\n\n### setDatabaseDialect\n\nOptional. The dialect of the Cloud Spanner Database.\n\n### getProtoDescriptors\n\nOptional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in\n'extra_statements' above.\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 in\n'extra_statements' above.\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### static::build"]]