public interface DatabaseAdminClient
Modifier and Type | Method and Description |
---|---|
Operation<Database,com.google.spanner.admin.database.v1.CreateDatabaseMetadata> |
createDatabase(String instanceId,
String databaseId,
Iterable<String> statements)
Creates a new database in a Cloud Spanner instance.
|
void |
dropDatabase(String instanceId,
String databaseId)
Drops a Cloud Spanner database.
|
Database |
getDatabase(String instanceId,
String databaseId)
Gets the current state of a Cloud Spanner database.
|
List<String> |
getDatabaseDdl(String instanceId,
String databaseId)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements.
|
com.google.api.gax.paging.Page<Database> |
listDatabases(String instanceId,
Options.ListOption... options)
Returns the list of Cloud Spanner database in the given instance.
|
Operation<Void,com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata> |
updateDatabaseDdl(String instanceId,
String databaseId,
Iterable<String> statements,
String operationId)
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.
|
Operation<Database,com.google.spanner.admin.database.v1.CreateDatabaseMetadata> createDatabase(String instanceId, String databaseId, Iterable<String> statements) throws SpannerException
instanceId
- the id of the instance in which to create the database.databaseId
- the id of the database which will be created. It must conform to the regular
expression [a-z][a-z0-9_\-]*[a-z0-9] and be between 2 and 30 characters in lengthstatements
- DDL statements to run while creating the database, for example CREATE
TABLE MyTable ( ... )
. This should not include CREATE DATABASE
statement.SpannerException
Database getDatabase(String instanceId, String databaseId) throws SpannerException
SpannerException
Operation<Void,com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata> updateDatabaseDdl(String instanceId, String databaseId, Iterable<String> statements, @Nullable String operationId) throws SpannerException
operationId
- Operation id assigned to this operation. If null, system will autogenerate
one. This must be unique within a database abd must be a valid identifier
[a-zA-Z][a-zA-Z0-9_]*.SpannerException
void dropDatabase(String instanceId, String databaseId) throws SpannerException
SpannerException
List<String> getDatabaseDdl(String instanceId, String databaseId)
com.google.api.gax.paging.Page<Database> listDatabases(String instanceId, Options.ListOption... options)
Copyright © 2017 Google. All rights reserved.