I want to get the hikari transactor setup to act just like the standard transactor
val xa = HikariTransactor.newHikariTransactor[IO](
"com.mysql.jdbc.Driver",
JdbcUrl,
Username,
Password
)
sql"""select DISTINCT gcpProject FROM JobStatus"""
.query[String] // Query0[String]
.stream // Stream[ConnectionIO, String]
.take(5) // Stream[ConnectionIO, String]
.compile.toList // ConnectionIO[List[String]]
.transact(xa) // IO[List[String]]
.unsafeRunSync // List[String]
.foreach(println) // Unit
Unfortunately this gives me:
Type mismatch, expected: tansactor.Transactor[NotInferedM], actual: IO[hikari.HikariTransactor[IO]]
Any ideas on how can can get this working properly?
Just a note that the previous solution used a single connection each time and works correctly:
val xa = Transactor.fromDriverManager[IO](
"com.mysql.jdbc.Driver",
JdbcUrl,
Username,
Password
)
But I could really use a connection pool.