Transactor

doobie.util.transactor.Transactor
See theTransactor companion object
sealed abstract class Transactor[M[_]]

A thin wrapper around a source of database connections, an interpreter, and a strategy for running programs, parameterized over a target monad M and an arbitrary wrapped value A. Given a stream or program in ConnectionIO or a program in Kleisli, a Transactor can discharge the doobie machinery and yield an effectful stream or program in M.

Type parameters

M

a target effect type; typically IO

Attributes

Companion
object
Source
transactor.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Grouped members

Natural Transformations

def exec(implicit ev: MonadCancelThrow[M]): FunctionK[[_] =>> Kleisli[M, Connection, _$11], M]

Natural transformation that provides a connection and binds through a Kleisli program using the given Strategy, yielding an independent program in M.

Natural transformation that provides a connection and binds through a Kleisli program using the given Strategy, yielding an independent program in M.

Attributes

Source
transactor.scala
def rawExec(implicit ev: MonadCancelThrow[M]): FunctionK[[_] =>> Kleisli[M, Connection, _$9], M]

Natural transformation equivalent to exec that does not use the provided Strategy and instead directly binds the Connection provided by connect. This can be useful in cases where transactional handling is unsupported or undesired.

Natural transformation equivalent to exec that does not use the provided Strategy and instead directly binds the Connection provided by connect. This can be useful in cases where transactional handling is unsupported or undesired.

Attributes

Source
transactor.scala
def rawTrans(implicit ev: MonadCancelThrow[M]): FunctionK[ConnectionIO, M]

Natural transformation equivalent to trans that does not use the provided Strategy and instead directly binds the Connection provided by connect. This can be useful in cases where transactional handling is unsupported or undesired.

Natural transformation equivalent to trans that does not use the provided Strategy and instead directly binds the Connection provided by connect. This can be useful in cases where transactional handling is unsupported or undesired.

Attributes

Source
transactor.scala
def trans(implicit ev: MonadCancelThrow[M]): FunctionK[ConnectionIO, M]

Natural transformation that provides a connection and binds through a ConnectionIO program interpreted via the given interpreter, using the given Strategy, yielding an independent program in M. This is the most common way to run a doobie program.

Natural transformation that provides a connection and binds through a ConnectionIO program interpreted via the given interpreter, using the given Strategy, yielding an independent program in M. This is the most common way to run a doobie program.

Attributes

Source
transactor.scala

Configuration

def configure[B](f: A => M[B]): M[B]

Construct a program to perform arbitrary configuration on the kernel value (changing the timeout on a connection pool, for example). This can be the basis for constructing a configuration language for a specific kernel type A, whose operations can be added to compatible Transactors via implicit conversion.

Construct a program to perform arbitrary configuration on the kernel value (changing the timeout on a connection pool, for example). This can be the basis for constructing a configuration language for a specific kernel type A, whose operations can be added to compatible Transactors via implicit conversion.

Attributes

Source
transactor.scala

Type members

Types

type A

An arbitrary value that will be handed back to connect *

An arbitrary value that will be handed back to connect *

Attributes

Source
transactor.scala

Value members

Abstract methods

def connect: A => Resource[M, Connection]

A program in M that can provide a database connection, given the kernel *

A program in M that can provide a database connection, given the kernel *

Attributes

Source
transactor.scala

A natural transformation for interpreting ConnectionIO *

A natural transformation for interpreting ConnectionIO *

Attributes

Source
transactor.scala
def kernel: A

An arbitrary value, meaningful to the instance *

An arbitrary value, meaningful to the instance *

Attributes

Source
transactor.scala

A Strategy for running a program on a connection *

A Strategy for running a program on a connection *

Attributes

Source
transactor.scala

Concrete methods

def copy(kernel0: A, connect0: A => Resource[M, Connection], interpret0: Interpreter[M], strategy0: Strategy): Aux[M, A]

Attributes

Source
transactor.scala
def liftF[I](mkEffect: FunctionK[M, ConnectionIO] => ConnectionIO[I])(implicit ev: Async[M]): M[I]

Create a program expressed as ConnectionIO effect using a provided natural transformation M ~> ConnectionIO and translate it to back M effect.

Create a program expressed as ConnectionIO effect using a provided natural transformation M ~> ConnectionIO and translate it to back M effect.

Attributes

Source
transactor.scala
def liftP[I, O](inner: (ConnectionIO, I) => O)(implicit ev: Async[M]): (M, I) => O

Embed a Pipe with ConnectionIO effects inside a Pipe with M effects by lifting incoming stream to ConnectionIO effects and lowering outgoing stream to M effects.

Embed a Pipe with ConnectionIO effects inside a Pipe with M effects by lifting incoming stream to ConnectionIO effects and lowering outgoing stream to M effects.

Attributes

Source
transactor.scala
def liftS[I](mkStream: FunctionK[M, ConnectionIO] => Stream[ConnectionIO, I])(implicit ev: Async[M]): Stream[M, I]

Crate a program expressed as Stream with ConnectionIO effects using a provided natural transformation M ~> ConnectionIO and translate it back to a Stream with M effects.

Crate a program expressed as Stream with ConnectionIO effects using a provided natural transformation M ~> ConnectionIO and translate it back to a Stream with M effects.

Attributes

Source
transactor.scala
def mapK[M0[_]](fk: FunctionK[M, M0])(implicit ev1: MonadCancelThrow[M], ev2: MonadCancelThrow[M0]): Aux[M0, A]

Attributes

Source
transactor.scala
def rawTransP(implicit ev: MonadCancelThrow[M]): FunctionK[[_] =>> Stream[ConnectionIO, _$15], [_] =>> Stream[M, _$16]]

Attributes

Source
transactor.scala
def rawTransPK[I](implicit ev: MonadCancelThrow[M]): FunctionK[[_] =>> Stream[[_] =>> Kleisli[ConnectionIO, I, _$24], _$25], [_] =>> Stream[[_] =>> Kleisli[M, I, _$26], _$27]]

Attributes

Source
transactor.scala
def transP(implicit ev: MonadCancelThrow[M]): FunctionK[[_] =>> Stream[ConnectionIO, _$19], [_] =>> Stream[M, _$20]]

Attributes

Source
transactor.scala
def transPK[I](implicit ev: MonadCancelThrow[M]): FunctionK[[_] =>> Stream[[_] =>> Kleisli[ConnectionIO, I, _$33], _$34], [_] =>> Stream[[_] =>> Kleisli[M, I, _$35], _$36]]

Attributes

Source
transactor.scala
def yolo(implicit ev: Async[M]): Yolo[M]

Construct a Yolo for REPL experimentation.

Construct a Yolo for REPL experimentation.

Attributes

Source
transactor.scala