I'm trying to send an email in the same transaction as inserting user into a database with Doobie.
I know that I can lift IO
into ConnectionIO
by using Async[ConnectionIO].liftIO(catsIO)
where catsIO: IO[String]
But in my code I don't operate on IO
, I use F
with constraints, for example F[_]: Async
So then I can replace F
with my own monad for testing.
Is it possible to somehow lift an F[String]
into ConnectionIO[String]
without using IO
type directly?
Here is an answer I found for IO type: Doobie and DB access composition within 1 transaction