Class PreparedDbProvider
java.lang.Object
com.opentable.db.postgres.embedded.PreparedDbProvider
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new database, and return it as a JDBC connection string.Create a new database, and return it as a DataSource.createDataSourceFromConnectionInfo
(ConnectionInfo connectionInfo) Create a new Datasource given DBInfo.static PreparedDbProvider
forPreparer
(DatabasePreparer preparer) static PreparedDbProvider
forPreparer
(DatabasePreparer preparer, Iterable<Consumer<EmbeddedPostgres.Builder>> customizers) getConfigurationTweak
(String dbModuleName) Return configuration tweaks in a format appropriate for otj-jdbc DatabaseModule.
-
Method Details
-
forPreparer
-
forPreparer
public static PreparedDbProvider forPreparer(DatabasePreparer preparer, Iterable<Consumer<EmbeddedPostgres.Builder>> customizers) -
createDatabase
Create a new database, and return it as a JDBC connection string. NB: No two invocations will return the same database.- Returns:
- JDBC connection string.
- Throws:
SQLException
- SQLException if any
-
createNewDatabase
- Throws:
SQLException
-
createDataSourceFromConnectionInfo
Create a new Datasource given DBInfo. More common usage is to call createDatasource().- Parameters:
connectionInfo
- connection information- Returns:
- Datasource
-
createDataSource
Create a new database, and return it as a DataSource. No two invocations will return the same database.- Returns:
- Datasource the datasource
- Throws:
SQLException
- SQLException if any
-
getConfigurationTweak
Return configuration tweaks in a format appropriate for otj-jdbc DatabaseModule.- Parameters:
dbModuleName
- Name of the module- Returns:
- Configuration properties
- Throws:
SQLException
- SQLException if any
-