Provides a simplified utility layer for starting, operating, and shutting down a postgres docker container.
Will automatically pull the requested docker image before starting the container.
new
PostgresTestContainer(container: Container,connection: PostgresConnectionInfo,)
readonly
exec: this.container.exec
Execute a command in the Postgres container.
client(name: string,options?: PostgresConnectionOptions,): Sql
Get postgres client instance for the current container.
url(name: string,options?: PostgresConnectionOptions,): PostgresConnectionUrl
Return the connection URL for the Postgres container in the format:
postgres://${user}:${pass}@${host}:${port}/${database}.
Make sure to start the container before accessing this method or it will throw an error.
start(image: string,config?: Partial<PostgresConnectionInfo>,): Promise<PostgresTestContainer>
Start a new Postgres container.