Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ trait PgFixtures {
)

def jdbcConfig(cnt: PostgreSQLContainer): JdbcConfig =
JdbcConfig(LenientUri.unsafe(cnt.jdbcUrl), cnt.username, cnt.password)
JdbcConfig(LenientUri.unsafe(cnt.jdbcUrl), cnt.username, cnt.password, 10)

def dataSource(cnt: PostgreSQLContainer): Resource[IO, DataSource] =
StoreFixture.dataSource(jdbcConfig(cnt))
Expand Down
3 changes: 3 additions & 0 deletions modules/joex/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ docspell.joex {

# The database password.
password = ""
# The default maximum pool size for hikari JDBC-backen (10 is the default of hikari)
maximum-pool-size = 10
}

# Additional settings related to schema migration.
Expand Down Expand Up @@ -827,6 +829,7 @@ Docpell Update Check
url = "jdbc:postgresql://server:5432/db"
user = "pguser"
password = ""
maximum-pool-size = 10
}

# A mapping from a language to a postgres text search config. By
Expand Down
3 changes: 3 additions & 0 deletions modules/restserver/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ docspell.server {
url = "jdbc:postgresql://server:5432/db"
user = "pguser"
password = ""
maximum-pool-size = 10
}

# A mapping from a language to a postgres text search config. By
Expand Down Expand Up @@ -405,6 +406,8 @@ docspell.server {

# The database password.
password = ""
# The default maximum pool size for hikari JDBC-backen (10 is the default of hikari)
maximum-pool-size = 10
}

# Additional settings related to schema migration.
Expand Down
7 changes: 6 additions & 1 deletion modules/store/src/main/scala/docspell/store/JdbcConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ package docspell.store

import docspell.common.LenientUri

case class JdbcConfig(url: LenientUri, user: String, password: String) {
case class JdbcConfig(
url: LenientUri,
user: String,
password: String,
maximumPoolSize: Int
) {

val dbms: Db =
JdbcConfig.extractDbmsName(url).fold(sys.error, identity)
Expand Down
1 change: 1 addition & 0 deletions modules/store/src/main/scala/docspell/store/Store.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ object Store {
ds.setUsername(jdbc.user)
ds.setPassword(jdbc.password)
ds.setDriverClassName(jdbc.dbms.driverClass)
ds.setMaximumPoolSize(jdbc.maximumPoolSize)
}
logh = DoobieLogging[F](docspell.logging.getLogger[F])
xa = HikariTransactor[F](ds, connectEC, Some(logh))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ trait DatabaseTest

object DatabaseTest {
private def jdbcConfig(cnt: JdbcDatabaseContainer) =
JdbcConfig(LenientUri.unsafe(cnt.jdbcUrl), cnt.username, cnt.password)
JdbcConfig(LenientUri.unsafe(cnt.jdbcUrl), cnt.username, cnt.password, 10)

private def makeDataSourceFixture(cnt: IO[JdbcDatabaseContainer]) =
for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ object StoreFixture {
s"jdbc:h2:mem:$dbname;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;DB_CLOSE_DELAY=-1"
),
"sa",
""
"",
10
)

def fileDB(file: Path): JdbcConfig =
Expand All @@ -62,7 +63,8 @@ object StoreFixture {
s"jdbc:h2:file://${file.absolute.toString};MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE"
),
"sa",
""
"",
10
)

def dataSource(jdbc: JdbcConfig): Resource[IO, DataSource] = {
Expand Down