public class UniqueDatabase extends Object
src/test/resources/ddl/<database_name>.sql.
The database name is enriched with a unique suffix that guarantees complete isolation between runs
<database_name>_<suffix>| Modifier and Type | Field and Description |
|---|---|
private static Pattern |
COMMENT_PATTERN |
private static String[] |
CREATE_DATABASE_DDL |
private String |
databaseName |
private Path |
dbHistoryPath |
private static String |
DEFAULT_DATABASE |
private String |
identifier |
private String |
serverName |
private String |
templateName |
static ZoneId |
TIMEZONE |
| Modifier | Constructor and Description |
|---|---|
|
UniqueDatabase(String serverName,
String databaseName)
Creates an instance with given Debezium logical name and database name
|
private |
UniqueDatabase(String serverName,
String databaseName,
String identifier) |
|
UniqueDatabase(String serverName,
String databaseName,
UniqueDatabase sibling)
Creates an instance with given Debezium logical name and database name and id suffix same
as another database.
|
| Modifier and Type | Method and Description |
|---|---|
private String |
convertSQL(String sql) |
void |
createAndInitialize()
Creates the database and populates it with initialization SQL script.
|
void |
createAndInitialize(Map<String,Object> urlProperties)
Creates the database and populates it with initialization SQL script.
|
Configuration.Builder |
defaultConfig() |
Configuration.Builder |
defaultJdbcConfigBuilder() |
String |
getDatabaseName() |
String |
getIdentifier() |
protected String |
getServerName() |
String |
qualifiedTableName(String tableName) |
ZoneId |
timezone() |
String |
topicForTable(String tableName) |
UniqueDatabase |
withDbHistoryPath(Path dbHistoryPath) |
public static final ZoneId TIMEZONE
private static final String DEFAULT_DATABASE
private static final String[] CREATE_DATABASE_DDL
private static final Pattern COMMENT_PATTERN
private final String databaseName
private final String templateName
private final String serverName
private Path dbHistoryPath
private final String identifier
public UniqueDatabase(String serverName, String databaseName)
serverName - - logical Debezium server namedatabaseName - - the name of the database (prix)public UniqueDatabase(String serverName, String databaseName, UniqueDatabase sibling)
serverName - - logical Debezium server namedatabaseName - - the name of the database (prix)sibling - - a database whose unique suffix will be usedpublic String getDatabaseName()
public String topicForTable(String tableName)
tableName - <serverName>.<databaseName>.<tableName>public String qualifiedTableName(String tableName)
tableName - <databaseName>.<tableName>protected String getServerName()
public void createAndInitialize()
public void createAndInitialize(Map<String,Object> urlProperties)
urlProperties - jdbc url propertiespublic UniqueDatabase withDbHistoryPath(Path dbHistoryPath)
dbHistoryPath - - directory where to store database schema historyFileDatabaseHistorypublic Configuration.Builder defaultJdbcConfigBuilder()
public Configuration.Builder defaultConfig()
public String getIdentifier()
public ZoneId timezone()
Copyright © 2019 JBoss by Red Hat. All rights reserved.