Enumeration

State

static

number

Indicates the current state of the database.

Value

STATE_UNSPECIFIED

Not specified.

CREATING

The database is still being created. Operations on the database may fail with FAILED_PRECONDITION in this state.

READY

The database is fully created and ready for use.

Property

State

static

number

Indicates the current state of the database.

Value

STATE_UNSPECIFIED

Not specified.

CREATING

The database is still being created. Operations on the database may fail with FAILED_PRECONDITION in this state.

READY

The database is fully created and ready for use.

Abstract types

CreateDatabaseMetadata

static

Metadata type for the operation returned by CreateDatabase.

Property

Parameter

database

string

The database being created.

See also

google.spanner.admin.database.v1.CreateDatabaseMetadata definition in proto format

CreateDatabaseRequest

static

The request for CreateDatabase.

Properties

Parameter

parent

string

Required. The name of the instance that will serve the new database. Values are of the form projects/<project>/instances/<instance>.

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 (`).

extraStatements

Array of string

An optional 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.

See also

google.spanner.admin.database.v1.CreateDatabaseRequest definition in proto format

Database

static

A Cloud Spanner database.

Properties

Parameter

name

string

Required. The name of the database. Values are of the form projects/<project>/instances/<instance>/databases/<database>, where <database> is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.

state

number

Output only. The current database state.

The number should be among the values of State

See also

google.spanner.admin.database.v1.Database definition in proto format

DropDatabaseRequest

static

The request for DropDatabase.

Property

Parameter

database

string

Required. The database to be dropped.

See also

google.spanner.admin.database.v1.DropDatabaseRequest definition in proto format

GetDatabaseDdlRequest

static

The request for GetDatabaseDdl.

Property

Parameter

database

string

Required. The database whose schema we wish to get.

See also

google.spanner.admin.database.v1.GetDatabaseDdlRequest definition in proto format

GetDatabaseDdlResponse

static

The response for GetDatabaseDdl.

Property

Parameter

statements

Array of string

A list of formatted DDL statements defining the schema of the database specified in the request.

See also

google.spanner.admin.database.v1.GetDatabaseDdlResponse definition in proto format

GetDatabaseRequest

static

The request for GetDatabase.

Property

Parameter

name

string

Required. The name of the requested database. Values are of the form projects/<project>/instances/<instance>/databases/<database>.

See also

google.spanner.admin.database.v1.GetDatabaseRequest definition in proto format

ListDatabasesRequest

static

The request for ListDatabases.

Properties

Parameter

parent

string

Required. The instance whose databases should be listed. Values are of the form projects/<project>/instances/<instance>.

pageSize

number

Number of databases to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size.

pageToken

string

If non-empty, page_token should contain a next_page_token from a previous ListDatabasesResponse.

See also

google.spanner.admin.database.v1.ListDatabasesRequest definition in proto format

ListDatabasesResponse

static

The response for ListDatabases.

Properties

Parameter

databases

Array of Object

Databases that matched the request.

This object should have the same structure as Database

nextPageToken

string

next_page_token can be sent in a subsequent ListDatabases call to fetch more of the matching databases.

See also

google.spanner.admin.database.v1.ListDatabasesResponse definition in proto format

UpdateDatabaseDdlMetadata

static

Metadata type for the operation returned by UpdateDatabaseDdl.

Properties

Parameter

database

string

The database being modified.

statements

Array of string

For an update this list contains all the statements. For an individual statement, this list contains only that statement.

commitTimestamps

Array of Object

Reports the commit timestamps of all statements that have succeeded so far, where commit_timestamps[i] is the commit timestamp for the statement statements[i].

This object should have the same structure as Timestamp

See also

google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata definition in proto format

UpdateDatabaseDdlRequest

static

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.

Properties

Parameter

database

string

Required. The database to update.

statements

Array of string

DDL statements to be applied to the database.

operationId

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.

See also

google.spanner.admin.database.v1.UpdateDatabaseDdlRequest definition in proto format