use of com.google.cloud.teleport.spanner.ddl.InformationSchemaScanner in project DataflowTemplates by GoogleCloudPlatform.
the class CopyDbTest method readDdl.
/* Returns the Ddl representing a Spanner database for given a String for the database name */
private Ddl readDdl(String db, Dialect dialect) {
DatabaseClient dbClient = spannerServer.getDbClient(db);
Ddl ddl;
try (ReadOnlyTransaction ctx = dbClient.readOnlyTransaction()) {
ddl = new InformationSchemaScanner(ctx, dialect).scan();
}
return ddl;
}
use of com.google.cloud.teleport.spanner.ddl.InformationSchemaScanner in project DataflowTemplates by GoogleCloudPlatform.
the class ExportTimestampTest method readDdl.
private Ddl readDdl(String db) {
SpannerOptions spannerOptions = SpannerOptions.newBuilder().build();
Spanner client = spannerOptions.getService();
Ddl ddl;
try (ReadOnlyTransaction ctx = spannerServer.getDbClient(db).readOnlyTransaction()) {
ddl = new InformationSchemaScanner(ctx).scan();
}
return ddl;
}
Aggregations