All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.atnos.eff.syntax.addon.doobie.scala Maven / Gradle / Ivy

The newest version!
package org.atnos.eff.syntax.addon

import _root_.doobie.Transactor
import _root_.doobie.free.connection.ConnectionIO
import cats.effect.Bracket
import org.atnos.eff.addon.doobie._
import org.atnos.eff.Eff
import org.atnos.eff._

trait doobie {

  implicit final def toDoobieConnectionIOOps[R, A](e: Eff[R, A]): DoobieConnectionIOOps[R, A] =
    new DoobieConnectionIOOps[R, A](e)

}

final class DoobieConnectionIOOps[R, A](private val e: Eff[R, A]) extends AnyVal {
  def runConnectionIO[F[_], U, E, B](
    t: Transactor[F]
  )(implicit mc: Member.Aux[ConnectionIO, R, U], mf: MemberInOut[F, U], me: Bracket[F, Throwable]): Eff[U, A] = {
    DoobieConnectionIOInterpretation.runConnectionIO[R, U, F, E, A, B](e)(t)
  }
}

object doobie extends doobie




© 2015 - 2024 Weber Informatics LLC | Privacy Policy