DB

pillars.db.DB
See theDB companion object
final case class DB[F[_]](config: DatabaseConfig, pool: Resource[F, Session[F]])(implicit evidence$1: Async[F], evidence$2: Network[F], evidence$3: Tracer[F], evidence$4: Console[F]) extends Module[F]

Attributes

Companion
object
Source
db.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Module[F]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

override type ModuleConfig = DatabaseConfig

Attributes

Source
db.scala

Value members

Concrete methods

override def probes: List[Probe[F]]

Attributes

Definition Classes
Source
db.scala

Inherited methods

Attributes

Inherited from:
Module
Source
modules.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Exports

Defined exports

def allocated[B >: Resource.this.A](implicit F: MonadCancel[Resource.this.F, Throwable]): Resource.this.F[(B, Resource.this.F[Unit])]
Exported from Resource

Given a Resource, possibly built by composing multiple Resources monadically, returns the acquired resource, as well as an action that runs all the finalizers for releasing it.

Given a Resource, possibly built by composing multiple Resources monadically, returns the acquired resource, as well as an action that runs all the finalizers for releasing it.

If the outer F fails or is interrupted, allocated guarantees that the finalizers will be called. However, if the outer F succeeds, it's up to the user to ensure the returned F[Unit] is called once A needs to be released. If the returned F[Unit] is not called, the finalizers will not be run.

For this reason, this is an advanced and potentially unsafe api which can cause a resource leak if not used correctly, please prefer use as the standard way of running a Resource program.

Use cases include interacting with side-effectful apis that expect separate acquire and release actions (like the before and after methods of many test frameworks), or complex library code that needs to modify or move the finalizer for an existing resource.

Attributes

Source
Resource.scala
def allocatedCase[B >: Resource.this.A](implicit F: MonadCancel[Resource.this.F, Throwable]): Resource.this.F[(B, ExitCase => Resource.this.F[Unit])]
Exported from Resource

Given a Resource, possibly built by composing multiple Resources monadically, returns the acquired resource, as well as a cleanup function that takes an exit case and runs all the finalizers for releasing it.

Given a Resource, possibly built by composing multiple Resources monadically, returns the acquired resource, as well as a cleanup function that takes an exit case and runs all the finalizers for releasing it.

If the outer F fails or is interrupted, allocated guarantees that the finalizers will be called. However, if the outer F succeeds, it's up to the user to ensure the returned ExitCode => F[Unit] is called once A needs to be released. If the returned ExitCode => F[Unit] is not called, the finalizers will not be run.

For this reason, this is an advanced and potentially unsafe api which can cause a resource leak if not used correctly, please prefer use as the standard way of running a Resource program.

Use cases include interacting with side-effectful apis that expect separate acquire and release actions (like the before and after methods of many test frameworks), or complex library code that needs to modify or move the finalizer for an existing resource.

Attributes

Source
Resource.scala
def attempt[E](implicit F: ApplicativeError[Resource.this.F, E]): Resource[Resource.this.F, Either[E, Resource.this.A]]
Exported from Resource

Attributes

Source
Resource.scala
def evalMap[B](f: Resource.this.A => Resource.this.F[B]): Resource[Resource.this.F, B]
Exported from Resource

Applies an effectful transformation to the allocated resource. Like a flatMap on F[A] while maintaining the resource context

Applies an effectful transformation to the allocated resource. Like a flatMap on F[A] while maintaining the resource context

Attributes

Source
Resource.scala
def evalTap[B](f: Resource.this.A => Resource.this.F[B]): Resource[Resource.this.F, Resource.this.A]
Exported from Resource

Applies an effectful transformation to the allocated resource. Like a flatTap on F[A] while maintaining the resource context

Applies an effectful transformation to the allocated resource. Like a flatTap on F[A] while maintaining the resource context

Attributes

Source
Resource.scala
def flatMap[B](f: Resource.this.A => Resource[Resource.this.F, B]): Resource[Resource.this.F, B]
Exported from Resource

Implementation for the flatMap operation, as described via the cats.Monad type class.

Implementation for the flatMap operation, as described via the cats.Monad type class.

Attributes

Source
Resource.scala
def map[B](f: Resource.this.A => B): Resource[Resource.this.F, B]
Exported from Resource

Given a mapping function, transforms the resource provided by this Resource.

Given a mapping function, transforms the resource provided by this Resource.

This is the standard Functor.map.

Attributes

Source
Resource.scala
def useEval[B](implicit ev: Resource.this.A <:< Resource.this.F[B], F: MonadCancel[Resource.this.F, Throwable]): Resource.this.F[B]
Exported from Resource

For a resource that allocates an action (type F[B]), allocate that action, run it and release it.

For a resource that allocates an action (type F[B]), allocate that action, run it and release it.

Attributes

Source
Resource.scala
def useKleisliK[B >: Resource.this.A](implicit F: MonadCancel[Resource.this.F, Throwable]): FunctionK[[_] =>> Kleisli[Resource.this.F, B, _$6], Resource.this.F]
Exported from Resource

Creates a FunctionK that, when applied, will allocate the resource and use it to run the given Kleisli.

Creates a FunctionK that, when applied, will allocate the resource and use it to run the given Kleisli.

Attributes

Source
Resource.scala