Class PreparedDbProvider
- java.lang.Object
-
- com.opentable.db.postgres.embedded.PreparedDbProvider
-
public class PreparedDbProvider extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PreparedDbProvider.DbInfo
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createDatabase()
Create a new database, and return it as a JDBC connection string.DataSource
createDataSource()
Create a new database, and return it as a DataSource.DataSource
createDataSourceFromConnectionInfo(ConnectionInfo connectionInfo)
Create a new Datasource given DBInfo.ConnectionInfo
createNewDatabase()
static PreparedDbProvider
forPreparer(DatabasePreparer preparer)
static PreparedDbProvider
forPreparer(DatabasePreparer preparer, Iterable<Consumer<EmbeddedPostgres.Builder>> customizers)
Map<String,String>
getConfigurationTweak(String dbModuleName)
Return configuration tweaks in a format appropriate for otj-jdbc DatabaseModule.
-
-
-
Method Detail
-
forPreparer
public static PreparedDbProvider forPreparer(DatabasePreparer preparer)
-
forPreparer
public static PreparedDbProvider forPreparer(DatabasePreparer preparer, Iterable<Consumer<EmbeddedPostgres.Builder>> customizers)
-
createDatabase
public String createDatabase() throws SQLException
Create a new database, and return it as a JDBC connection string. NB: No two invocations will return the same database.- Throws:
SQLException
-
createNewDatabase
public ConnectionInfo createNewDatabase() throws SQLException
- Throws:
SQLException
-
createDataSourceFromConnectionInfo
public DataSource createDataSourceFromConnectionInfo(ConnectionInfo connectionInfo) throws SQLException
Create a new Datasource given DBInfo. More common usage is to call createDatasource().- Throws:
SQLException
-
createDataSource
public DataSource createDataSource() throws SQLException
Create a new database, and return it as a DataSource. No two invocations will return the same database.- Throws:
SQLException
-
getConfigurationTweak
public Map<String,String> getConfigurationTweak(String dbModuleName) throws SQLException
Return configuration tweaks in a format appropriate for otj-jdbc DatabaseModule.- Throws:
SQLException
-
-