io.laserdisc.mysql.binlog.database.database.scala Maven / Gradle / Ivy
The newest version!
package io.laserdisc.mysql.binlog
import cats.effect._
import doobie._
import doobie.hikari.HikariTransactor
import io.laserdisc.mysql.binlog.config.BinLogConfig
package object database {
def transactor[F[_]: Async](
config: BinLogConfig
): Resource[F, HikariTransactor[F]] =
for {
ce <- ExecutionContexts.fixedThreadPool[F](32) // our connect EC
_ <- Resource.eval(Sync[F].delay(Class.forName(config.driverClass)))
xa <- HikariTransactor.newHikariTransactor[F](
config.driverClass,
config.connectionURL,
config.user,
config.password,
ce
)
} yield xa
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy