mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Update doobie to 1.0.0-RC4
This commit is contained in:
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user