Update doobie to 1.0.0-RC4

This commit is contained in:
eikek
2023-11-06 11:43:02 +01:00
parent 3cb0172312
commit 4874739e18
9 changed files with 71 additions and 35 deletions

View File

@ -9,17 +9,9 @@ package docspell.ftspsql
import docspell.common._
import doobie._
import doobie.util.log.Success
trait DoobieMeta {
implicit val sqlLogging: LogHandler = LogHandler {
case e @ Success(_, _, _, _) =>
DoobieMeta.logger.debug("SQL " + e)
case e =>
DoobieMeta.logger.error(s"SQL Failure: $e")
}
implicit val metaIdent: Meta[Ident] =
Meta[String].timap(Ident.unsafe)(_.id)
@ -29,7 +21,3 @@ trait DoobieMeta {
implicit val metaCollectiveId: Meta[CollectiveId] =
Meta[Long].timap(CollectiveId(_))(_.value)
}
object DoobieMeta {
private val logger = org.log4s.getLogger
}

View File

@ -15,6 +15,7 @@ import fs2.Stream
import docspell.common._
import docspell.ftsclient._
import docspell.logging.Logger
import docspell.store.impl.DoobieLogging
import com.zaxxer.hikari.HikariDataSource
import doobie._
@ -157,7 +158,8 @@ object PsqlFtsClient {
ds.setPassword(cfg.password.pass)
ds.setDriverClassName("org.postgresql.Driver")
}
xa = HikariTransactor[F](ds, connectEC)
logh = DoobieLogging[F](docspell.logging.getLogger[F])
xa = HikariTransactor[F](ds, connectEC, Some(logh))
pc = new PsqlFtsClient[F](cfg, xa)
} yield pc