Creates a new Spanner database and starts to prepare it for serving. The returned long-running operation will have a name of the format <database_name>/operations/<operationId> and can be used to track preparation of the database. The metadata field type is CreateDatabaseMetadata. The response field type is Database, if successful.
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 (`).
extraStatements[]
string
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.
Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in 'extraStatements'. Contains a protobuf-serialized google.protobuf.FileDescriptorSet descriptor set. 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-06-18 UTC."],[],[],null,["# Method: projects.instances.databases.create\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\nCreates a new Spanner database and starts to prepare it for serving. The returned long-running operation will have a name of the format `\u003cdatabase_name\u003e/operations/\u003coperationId\u003e` and can be used to track preparation of the database. The metadata field type is [CreateDatabaseMetadata](/spanner/docs/reference/rest/v1/CreateDatabaseMetadata). The response field type is [Database](/spanner/docs/reference/rest/v1/projects.instances.databases#Database), if successful.\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 a newly created 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)."]]