Class EmbeddedPostgres
java.lang.Object
com.opentable.db.postgres.embedded.EmbeddedPostgres
- All Implemented Interfaces:
Closeable,AutoCloseable
Core class of the library, providing a builder (with reasonable defaults) to wrap
testcontainers and launch postgres container.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic EmbeddedPostgres.Builderbuilder()voidclose()getDatabase(String userName, String dbName) getHost()getJdbcUrl(String dbName) Returns JDBC connection string for specified databaseintgetPort()getPostgresDatabase(Map<String, String> properties) getTemplateDatabase(Map<String, String> properties) static EmbeddedPostgresstart()toString()
-
Method Details
-
getTemplateDatabase
-
getTemplateDatabase
-
getPostgresDatabase
-
getPostgresDatabase
-
getDatabase
-
getDatabase
-
getJdbcUrl
Returns JDBC connection string for specified database- Parameters:
dbName- Database name- Returns:
- URL
-
getHost
-
getPort
public int getPort() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
start
- Throws:
IOException
-
builder
-
getUserName
-
getPassword
-
toString
-