It seems that simple
type Db[F[_], A] = Kleisli[F, Connection, A]
type Transactor[DB[_], F[_]] = DB ~> F
Сan be used to build functional JDBC layer as well
Summed up from @SystemFw and @tpolecat answers from https://gitter.im/scala/scala?at=5cfe6505bf4cbd167c619960
Pros of Free Monad:
F[_]
so improper (asynchronous) effect can't be used within transaction boundary. It is important since most JDBC drivers have designed java.sql.Connection
implementation to be single-threaded.Cons of Free Monad:
F[_]
so you can't nest specific effects within transaction.Doobie will have tagless version in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With