public class Database extends DatabaseInfo
Database
adds a layer of service related
functionality over DatabaseInfo
.DatabaseInfo.State
Constructor and Description |
---|
Database(DatabaseId id,
DatabaseInfo.State state,
DatabaseAdminClient dbClient) |
Modifier and Type | Method and Description |
---|---|
void |
drop()
Drops this database.
|
Iterable<String> |
getDdl()
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements.
|
Database |
reload()
Fetches the database's current information.
|
OperationFuture<Void,com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata> |
updateDdl(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.
|
public Database(DatabaseId id, DatabaseInfo.State state, DatabaseAdminClient dbClient)
public Database reload() throws SpannerException
SpannerException
public OperationFuture<Void,com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata> updateDdl(Iterable<String> statements, 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
public void drop() throws SpannerException
SpannerException
public Iterable<String> getDdl() throws SpannerException
SpannerException
Copyright © 2019 Google LLC. All rights reserved.