Skip to content

Commit

Permalink
add schema param
Browse files Browse the repository at this point in the history
  • Loading branch information
jjba23 committed Oct 21, 2024
1 parent 64bfd2b commit 63ab33d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ThisBuild / sonatypeCredentialHost := sonatypeCentralHost

ThisBuild / publishTo := sonatypePublishToBundle.value

ThisBuild / version := "0.9.3"
ThisBuild / version := "0.9.4"

ThisBuild / resolvers += "Mulesoft".at(
"https://repository.mulesoft.org/nexus/content/repositories/public/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import org.apache.commons.dbcp2.BasicDataSource
import slick.jdbc.JdbcBackend

object PostgreSQLPool {
def layer: ZLayer[
def layer(
schema: String = "public",
validationQuery: String = "SELECT 1 + 1"
): ZLayer[
PostgreSQLContainer.Container,
Throwable,
JdbcBackend.Database
Expand All @@ -21,11 +24,12 @@ object PostgreSQLPool {
)
ds.setUsername(postgresqlContainer.value.getUsername())
ds.setPassword(postgresqlContainer.value.getPassword())
ds.setMaxTotal(30);
ds.setMaxIdle(10);
ds.setInitialSize(10);
ds.setMaxTotal(30)
ds.setMaxIdle(10)
ds.setInitialSize(10)
ds.setDefaultSchema(schema)
ds.setValidationQuery(
"SELECT 1 + 1"
validationQuery
)
ds.setUrl(postgresqlContainer.value.getJdbcUrl())
ds
Expand Down
2 changes: 1 addition & 1 deletion zzspec/src/test/scala/postgresqltest/PostgreSQLSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object PostgreSQLSpec extends ZIOSpecDefault {
containerLogger(),
PostgreSQLContainer.Settings.layer(),
PostgreSQLContainer.layer(),
PostgreSQLPool.layer,
PostgreSQLPool.layer(),
)

def basicPostgreSQLOperationsTest
Expand Down

0 comments on commit 63ab33d

Please sign in to comment.