SlickPostgresContainer

slick.additions.testcontainers.SlickPostgresContainer
class SlickPostgresContainer(imageName: DockerImageName) extends PostgreSQLContainer[SlickPostgresContainer]

A PostgreSQL TestContainers container with convenience methods to connect to it from Slick.

Value parameters

imageName

the DockerImageName. Defaults to postgres, but it can another compatible image too. See https://java.testcontainers.org/modules/databases/postgres/ for details.

Attributes

Graph
Supertypes
class PostgreSQLContainer[SlickPostgresContainer]
class JdbcDatabaseContainer[SlickPostgresContainer]
class GenericContainer[SlickPostgresContainer]
trait Startable
trait WaitStrategyTarget
trait AutoCloseable
trait Container[SlickPostgresContainer]
trait ContainerState
trait LinkableContainer
class FailureDetectingExternalResource
trait TestRule
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def port: Integer

The port that can be used to connect to the database from the host

The port that can be used to connect to the database from the host

Attributes

See also
def slickConfig(databaseName: String): Config

Returns a Typesafe Config object that describes how to connect to the database. It can be passed to Database.forConfig to get a Database object.

Returns a Typesafe Config object that describes how to connect to the database. It can be passed to Database.forConfig to get a Database object.

Value parameters

databaseName

optionally specify a database name other than the TestContainers default

Attributes

Example
   val container = new SlickPostgresContainer
   container.start()
   import slick.jdbc.PostgresProfile.api.*
   val database = Database.forConfig("", container.slickConfig)
def slickDatabase(backend: JdbcBackend, databaseName: String, numThreads: Int, queueSize: Int): backend.JdbcDatabaseDef

Returns a Slick Database object that can connect to the database and run Slick actions.

Returns a Slick Database object that can connect to the database and run Slick actions.

Value parameters

backend

a JdbcBackend. Optional, but it may be necessary to pass e.g., MyProfile.backend to infer the right path-dependent type.

databaseName

Optionally specify a database name. Otherwise getDatabaseName will be used.

numThreads

The size of Slick's thread pool (default 20)

queueSize

The job queue size, 0 for direct hand-off or -1 for unlimited size. Defaults to 1000.

Attributes

See also

AsyncExecutor

Inherited methods

def addEnv(x$0: String, x$1: String): Unit

Attributes

Inherited from:
GenericContainer
def addExposedPort(x$0: Integer): Unit

Attributes

Inherited from:
GenericContainer
def addExposedPorts(x$0: Int*): Unit

Attributes

Inherited from:
GenericContainer
def addFileSystemBind(x$0: String, x$1: String, x$2: BindMode, x$3: SelinuxContext): Unit

Attributes

Inherited from:
GenericContainer
def addParameter(x$0: String, x$1: String): Unit

Attributes

Inherited from:
JdbcDatabaseContainer
def close(): Unit

Attributes

Inherited from:
Startable
def copyFileFromContainer(x$0: String, x$1: String): Unit

Attributes

Inherited from:
GenericContainer
def copyFileFromContainer[T <: <FromJavaObject>](x$0: String, x$1: ThrowingFunction[InputStream, T]): T

Attributes

Inherited from:
ContainerState
def copyFileToContainer(x$0: Transferable, x$1: String): Unit

Attributes

Inherited from:
ContainerState
def copyFileToContainer(x$0: MountableFile, x$1: String): Unit

Attributes

Inherited from:
ContainerState
def createConnection(x$0: String, x$1: Properties): Connection

Attributes

Inherited from:
JdbcDatabaseContainer
def createConnection(x$0: String): Connection

Attributes

Inherited from:
JdbcDatabaseContainer
def dependsOn(x$0: Iterable[_ <: Startable]): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def dependsOn(x$0: List[_ <: Startable]): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def dependsOn(x$0: Startable*): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def equals(x$0: <FromJavaObject>): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Inherited from:
GenericContainer
def execInContainer(x$0: Charset, x$1: ExecConfig): ExecResult

Attributes

Inherited from:
ContainerState
def execInContainer(x$0: ExecConfig): ExecResult

Attributes

Inherited from:
ContainerState
def execInContainer(x$0: Charset, x$1: String*): ExecResult

Attributes

Inherited from:
ContainerState
def execInContainer(x$0: String*): ExecResult

Attributes

Inherited from:
ContainerState
def followOutput(x$0: Consumer[OutputFrame], x$1: OutputType*): Unit

Attributes

Inherited from:
Container
def followOutput(x$0: Consumer[OutputFrame]): Unit

Attributes

Inherited from:
Container
def getBinds(): List[Bind]

Attributes

Inherited from:
GenericContainer
def getBoundPortNumbers(): List[Integer]

Attributes

Inherited from:
ContainerState
def getCommandParts(): Array[String]

Attributes

Inherited from:
GenericContainer
def getContainerId(): String

Attributes

Inherited from:
GenericContainer
def getContainerInfo(): InspectContainerResponse

Attributes

Inherited from:
GenericContainer
def getContainerName(): String

Attributes

Inherited from:
GenericContainer
def getCreateContainerCmdModifiers(): Set[CreateContainerCmdModifier]

Attributes

Inherited from:
GenericContainer
def getCurrentContainerInfo(): InspectContainerResponse

Attributes

Inherited from:
ContainerState
def getDatabaseName(): String

Attributes

Inherited from:
PostgreSQLContainer
def getDependencies(): Set[Startable]

Attributes

Inherited from:
GenericContainer
def getDockerClient(): DockerClient

Attributes

Inherited from:
GenericContainer
def getDockerImageName(): String

Attributes

Inherited from:
GenericContainer
def getDriverClassName(): String

Attributes

Inherited from:
PostgreSQLContainer
def getEnv(): List[String]

Attributes

Inherited from:
GenericContainer
def getEnvMap(): Map[String, String]

Attributes

Inherited from:
GenericContainer
def getExposedPorts(): List[Integer]

Attributes

Inherited from:
GenericContainer
def getExtraHosts(): List[String]

Attributes

Inherited from:
GenericContainer
def getFirstMappedPort(): Integer

Attributes

Inherited from:
ContainerState
def getHost(): String

Attributes

Inherited from:
ContainerState
def getImage(): RemoteDockerImage

Attributes

Inherited from:
GenericContainer
def getJdbcDriverInstance(): Driver

Attributes

Inherited from:
JdbcDatabaseContainer
def getJdbcUrl(): String

Attributes

Inherited from:
PostgreSQLContainer
def getLabels(): Map[String, String]

Attributes

Inherited from:
GenericContainer
def getLivenessCheckPortNumbers(): Set[Integer]

Attributes

Inherited from:
GenericContainer
def getLogConsumers(): List[Consumer[OutputFrame]]

Attributes

Inherited from:
GenericContainer
def getLogs(x$0: OutputType*): String

Attributes

Inherited from:
ContainerState
def getLogs(): String

Attributes

Inherited from:
ContainerState
def getMappedPort(x$0: Int): Integer

Attributes

Inherited from:
ContainerState
def getNetwork(): Network

Attributes

Inherited from:
GenericContainer
def getNetworkAliases(): List[String]

Attributes

Inherited from:
GenericContainer
def getNetworkMode(): String

Attributes

Inherited from:
GenericContainer
def getPassword(): String

Attributes

Inherited from:
PostgreSQLContainer
def getPortBindings(): List[String]

Attributes

Inherited from:
GenericContainer
@Nullable
def getShmSize(): Long

Attributes

Inherited from:
GenericContainer
def getStartupAttempts(): Int

Attributes

Inherited from:
GenericContainer
def getStartupCheckStrategy(): StartupCheckStrategy

Attributes

Inherited from:
GenericContainer
def getTestQueryString(): String

Attributes

Inherited from:
PostgreSQLContainer
@Nullable
def getTmpFsMapping(): Map[String, String]

Attributes

Inherited from:
GenericContainer
def getUsername(): String

Attributes

Inherited from:
PostgreSQLContainer
def getVolumesFroms(): List[VolumesFrom]

Attributes

Inherited from:
GenericContainer
@Nullable
def getWorkingDirectory(): String

Attributes

Inherited from:
GenericContainer
def hashCode(): Int

Calculates a hash code value for the object.

Calculates a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Inherited from:
GenericContainer
def isCreated(): Boolean

Attributes

Inherited from:
ContainerState
def isHealthy(): Boolean

Attributes

Inherited from:
ContainerState
def isHostAccessible(): Boolean

Attributes

Inherited from:
GenericContainer
def isPrivilegedMode(): Boolean

Attributes

Inherited from:
GenericContainer
def isRunning(): Boolean

Attributes

Inherited from:
ContainerState
def isShouldBeReused(): Boolean

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
Container
def setBinds(x$0: List[Bind]): Unit

Attributes

Inherited from:
GenericContainer
def setCommand(x$0: String*): Unit

Attributes

Inherited from:
GenericContainer
def setCommand(x$0: String): Unit

Attributes

Inherited from:
GenericContainer
def setCommandParts(x$0: Array[String]): Unit

Attributes

Inherited from:
GenericContainer
def setContainerDef(x$0: ContainerDef): Unit

Attributes

Inherited from:
GenericContainer
def setDockerImageName(x$0: String): Unit

Attributes

Inherited from:
GenericContainer
def setEnv(x$0: List[String]): Unit

Attributes

Inherited from:
GenericContainer
def setExposedPorts(x$0: List[Integer]): Unit

Attributes

Inherited from:
GenericContainer
def setExtraHosts(x$0: List[String]): Unit

Attributes

Inherited from:
GenericContainer
def setHostAccessible(x$0: Boolean): Unit

Attributes

Inherited from:
GenericContainer
def setImage(x$0: Future[String]): Unit

Attributes

Inherited from:
GenericContainer
def setLabels(x$0: Map[String, String]): Unit

Attributes

Inherited from:
GenericContainer
def setLogConsumers(x$0: List[Consumer[OutputFrame]]): Unit

Attributes

Inherited from:
GenericContainer
def setNetwork(x$0: Network): Unit

Attributes

Inherited from:
GenericContainer
def setNetworkAliases(x$0: List[String]): Unit

Attributes

Inherited from:
GenericContainer
def setNetworkMode(x$0: String): Unit

Attributes

Inherited from:
GenericContainer
def setParameters(x$0: Map[String, String]): Unit

Attributes

Inherited from:
JdbcDatabaseContainer
def setPortBindings(x$0: List[String]): Unit

Attributes

Inherited from:
GenericContainer
def setPrivilegedMode(x$0: Boolean): Unit

Attributes

Inherited from:
GenericContainer
def setShmSize(x$0: Long): Unit

Attributes

Inherited from:
GenericContainer
def setStartupAttempts(x$0: Int): Unit

Attributes

Inherited from:
GenericContainer
def setStartupCheckStrategy(x$0: StartupCheckStrategy): Unit

Attributes

Inherited from:
GenericContainer
def setTmpFsMapping(x$0: Map[String, String]): Unit

Attributes

Inherited from:
GenericContainer
def setVolumesFroms(x$0: List[VolumesFrom]): Unit

Attributes

Inherited from:
GenericContainer
def setWaitStrategy(x$0: WaitStrategy): Unit

Attributes

Inherited from:
GenericContainer
def setWorkingDirectory(x$0: String): Unit

Attributes

Inherited from:
GenericContainer
def start(): Unit

Attributes

Inherited from:
GenericContainer
def stop(): Unit

Attributes

Inherited from:
GenericContainer
def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Inherited from:
GenericContainer
def waitingFor(x$0: WaitStrategy): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
GenericContainer
def withClasspathResourceMapping(x$0: String, x$1: String, x$2: BindMode, x$3: SelinuxContext): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withClasspathResourceMapping(x$0: String, x$1: String, x$2: BindMode): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withCommand(x$0: String*): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
JdbcDatabaseContainer
def withCopyFileToContainer(x$0: MountableFile, x$1: String): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withCopyToContainer(x$0: Transferable, x$1: String): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withCreateContainerCmdModifier(x$0: Consumer[CreateContainerCmd]): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
PostgreSQLContainer
def withEnv(x$0: Map[String, String]): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withEnv(x$0: String, x$1: String): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withEnv(x$0: String, x$1: Function[Optional[String], String]): SlickPostgresContainer

Attributes

Inherited from:
Container

Attributes

Inherited from:
GenericContainer
def withExtraHost(x$0: String, x$1: String): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withFileSystemBind(x$0: String, x$1: String, x$2: BindMode): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withImagePullPolicy(x$0: ImagePullPolicy): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
JdbcDatabaseContainer
def withInitScripts(x$0: Iterable[String]): SlickPostgresContainer

Attributes

Inherited from:
JdbcDatabaseContainer

Attributes

Inherited from:
JdbcDatabaseContainer
def withLabel(x$0: String, x$1: String): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withLabels(x$0: Map[String, String]): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withLogConsumer(x$0: Consumer[OutputFrame]): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
GenericContainer
def withNetwork(x$0: Network): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
PostgreSQLContainer

Attributes

Inherited from:
GenericContainer
def withReuse(x$0: Boolean): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
GenericContainer
def withStartupCheckStrategy(x$0: StartupCheckStrategy): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
JdbcDatabaseContainer
def withTmpFs(x$0: Map[String, String]): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer
def withUrlParam(x$0: String, x$1: String): SlickPostgresContainer

Attributes

Inherited from:
JdbcDatabaseContainer

Attributes

Inherited from:
PostgreSQLContainer
def withVolumesFrom(x$0: Container[_], x$1: BindMode): SlickPostgresContainer

Attributes

Inherited from:
GenericContainer

Attributes

Inherited from:
GenericContainer

Deprecated and Inherited methods

@Deprecated
def addFileSystemBind(x$0: String, x$1: String, x$2: BindMode): Unit

Attributes

Deprecated
true
Inherited from:
Container
@Deprecated
def apply(x$0: Statement, x$1: Description): Statement

Attributes

Deprecated
true
Inherited from:
GenericContainer
@Deprecated
def execInContainerWithUser(x$0: Charset, x$1: String, x$2: String*): ExecResult

Attributes

Deprecated
true
Inherited from:
ContainerState
@Deprecated
def execInContainerWithUser(x$0: String, x$1: String*): ExecResult

Attributes

Deprecated
true
Inherited from:
ContainerState
@Deprecated
def getContainerIpAddress(): String

Attributes

Deprecated
true
Inherited from:
ContainerState
@Deprecated
def getCopyToFileContainerPathMap(): Map[MountableFile, String]

Attributes

Deprecated
true
Inherited from:
GenericContainer
@Deprecated
def getIpAddress(): String

Attributes

Deprecated
true
Inherited from:
GenericContainer
@Deprecated
def getLinkedContainers(): Map[String, LinkableContainer]

Attributes

Deprecated
true
Inherited from:
GenericContainer
@Deprecated
def getTestHostIpAddress(): String

Attributes

Deprecated
true
Inherited from:
GenericContainer
@Deprecated
def setCopyToFileContainerPathMap(x$0: Map[MountableFile, String]): Unit

Attributes

Deprecated
true
Inherited from:
GenericContainer
@Deprecated
def setLinkedContainers(x$0: Map[String, LinkableContainer]): Unit

Attributes

Deprecated
true
Inherited from:
GenericContainer
@Deprecated
def withFileSystemBind(x$0: String, x$1: String): SlickPostgresContainer

Attributes

Deprecated
true
Inherited from:
Container