← ZIO Query docs

ZQuery

zio.query.ZQuery
See theZQuery companion object
final class ZQuery[-R, +E, +A]

A ZQuery[R, E, A] is a purely functional description of an effectual query that may contain requests from one or more data sources, requires an environment R, and may fail with an E or succeed with an A.

Requests that can be performed in parallel, as expressed by zipWithPar and combinators derived from it, will automatically be batched. Requests that must be performed sequentially, as expressed by zipWith and combinators derived from it, will automatically be pipelined. This allows for aggressive data source specific optimizations. Requests can also be deduplicated and cached.

This allows for writing queries in a high level, compositional style, with confidence that they will automatically be optimized. For example, consider the following query from a user service.

val getAllUserIds: ZQuery[Any, Nothing, List[Int]]         = ???
def getUserNameById(id: Int): ZQuery[Any, Nothing, String] = ???

for {
 userIds   <- getAllUserIds
 userNames <- ZQuery.foreachPar(userIds)(getUserNameById)
} yield userNames

This would normally require N + 1 queries, one for getAllUserIds and one for each call to getUserNameById. In contrast, ZQuery will automatically optimize this to two queries, one for userIds and one for userNames, assuming an implementation of the user service that supports batching.

Based on "There is no Fork: an Abstraction for Efficient, Concurrent, and Concise Data Access" by Simon Marlow, Louis Brandy, Jonathan Coens, and Jon Purdy. http://simonmar.github.io/bib/papers/haxl-icfp14.pdf

Attributes

Companion
object
Source
ZQuery.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ZQuery[R, E, A]

Members list

Value members

Concrete methods

def &>[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

A symbolic alias for zipParRight.

A symbolic alias for zipParRight.

Attributes

Source
ZQuery.scala
def *>[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

A symbolic alias for zipRight.

A symbolic alias for zipRight.

Attributes

Source
ZQuery.scala
def <&[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, A]

A symbolic alias for zipParLeft.

A symbolic alias for zipParLeft.

Attributes

Source
ZQuery.scala
def <&>[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: Trace): ZQuery[R1, E1, zippable.Out]

A symbolic alias for zipPar.

A symbolic alias for zipPar.

Attributes

Source
ZQuery.scala
def <*[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, A]

A symbolic alias for zipLeft.

A symbolic alias for zipLeft.

Attributes

Source
ZQuery.scala
def <*>[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: Trace): ZQuery[R1, E1, zippable.Out]

A symbolic alias for zip.

A symbolic alias for zip.

Attributes

Source
ZQuery.scala
def <~[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, A]

A symbolic alias for zipBatchedLeft.

A symbolic alias for zipBatchedLeft.

Attributes

Source
ZQuery.scala
def <~>[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: Trace): ZQuery[R1, E1, zippable.Out]

A symbolic alias for zipBatched.

A symbolic alias for zipBatched.

Attributes

Source
ZQuery.scala
def @@[LowerR <: UpperR, UpperR <: R, LowerE >: E, UpperE >: LowerE, LowerA >: A, UpperA >: LowerA](aspect: => QueryAspect[LowerR, UpperR, LowerE, UpperE, LowerA, UpperA])(implicit trace: Trace): ZQuery[UpperR, LowerE, LowerA]

Syntax for adding aspects.

Syntax for adding aspects.

Attributes

Source
ZQuery.scala
def absolve[E1 >: E, B](implicit ev: IsSubtypeOfOutput[A, Either[E1, B]], trace: Trace): ZQuery[R, E1, B]

Returns a query which submerges the error case of Either into the error channel of the query

Returns a query which submerges the error case of Either into the error channel of the query

The inverse of ZQuery.either

Attributes

Source
ZQuery.scala
def as[B](b: => B)(implicit trace: Trace): ZQuery[R, E, B]

Maps the success value of this query to the specified constant value.

Maps the success value of this query to the specified constant value.

Attributes

Source
ZQuery.scala
def asExitMaybe: Option[Exit[E, A]]

Extracts the value of this ZQuery as an exit if the result of the query is known, and it does not contain any side effects.

Extracts the value of this ZQuery as an exit if the result of the query is known, and it does not contain any side effects.

This applies to queries that have been constructed via ZQuery.succeedNow and other xNow constructors. The only exception is ZQuery.fromZIONow, which is assumed to contain side effects unless the provided effect was an zio.Exit

Attributes

Source
ZQuery.scala
def asExitOrElse[E1 >: E, A1 >: A](default: Exit[E1, A1]): Exit[E1, A1]

Attributes

Source
ZQuery.scala
def asSomeError(implicit trace: Trace): ZQuery[R, Option[E], A]

Lifts the error channel into a Some value for composition with other optional queries

Lifts the error channel into a Some value for composition with other optional queries

Attributes

Source
ZQuery.scala
def cached(implicit trace: Trace): ZQuery[R, E, A]

Enables caching for this query. Note that caching is enabled by default so this will only be effective to enable caching in part of a larger query in which caching has been disabled.

Enables caching for this query. Note that caching is enabled by default so this will only be effective to enable caching in part of a larger query in which caching has been disabled.

Attributes

See also

memoize for memoizing the result of a single query

Source
ZQuery.scala
def catchAll[R1 <: R, E2, A1 >: A](h: E => ZQuery[R1, E2, A1])(implicit ev: CanFail[E], trace: Trace): ZQuery[R1, E2, A1]

Recovers from all errors.

Recovers from all errors.

Attributes

Source
ZQuery.scala
def catchAllCause[R1 <: R, E2, A1 >: A](h: (Cause[E]) => ZQuery[R1, E2, A1])(implicit trace: Trace): ZQuery[R1, E2, A1]

Recovers from all errors with provided Cause.

Recovers from all errors with provided Cause.

Attributes

Source
ZQuery.scala
def catchAllCauseZIO[R1 <: R, E2, A1 >: A](h: (Cause[E]) => ZIO[R1, E2, A1])(implicit trace: Trace): ZQuery[R1, E2, A1]

Recovers from all errors and maps the provided Cause to a ZIO effect

Recovers from all errors and maps the provided Cause to a ZIO effect

Attributes

Source
ZQuery.scala
def catchAllZIO[R1 <: R, E2, A1 >: A](h: E => ZIO[R1, E2, A1])(implicit ev: CanFail[E], trace: Trace): ZQuery[R1, E2, A1]

Catches all errors and maps them to a ZIO effect

Catches all errors and maps them to a ZIO effect

Attributes

Source
ZQuery.scala
def either(implicit ev: CanFail[E], trace: Trace): ZQuery[R, Nothing, Either[E, A]]

Returns a query whose failure and success have been lifted into an Either. The resulting query cannot fail, because the failure case has been exposed as part of the Either success case.

Returns a query whose failure and success have been lifted into an Either. The resulting query cannot fail, because the failure case has been exposed as part of the Either success case.

Attributes

Source
ZQuery.scala
def ensuring[R1 <: R](finalizer: => ZIO[R1, Nothing, Any])(implicit trace: Trace): ZQuery[R1, E, A]

Ensures that if this query starts executing, the specified query will be executed immediately after this query completes execution, whether by success or failure.

Ensures that if this query starts executing, the specified query will be executed immediately after this query completes execution, whether by success or failure.

Attributes

Source
ZQuery.scala
def flatMap[R1 <: R, E1 >: E, B](f: A => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

Returns a query that models execution of this query, followed by passing its result to the specified function that returns a query. Requests composed with flatMap or combinators derived from it will be executed sequentially and will not be pipelined, though deduplication and caching of requests may still be applied.

Returns a query that models execution of this query, followed by passing its result to the specified function that returns a query. Requests composed with flatMap or combinators derived from it will be executed sequentially and will not be pipelined, though deduplication and caching of requests may still be applied.

Attributes

Source
ZQuery.scala
def flatten[R1 <: R, E1 >: E, B](implicit ev: IsSubtypeOfOutput[A, ZQuery[R1, E1, B]], trace: Trace): ZQuery[R1, E1, B]

Returns a query that performs the outer query first, followed by the inner query, yielding the value of the inner query.

Returns a query that performs the outer query first, followed by the inner query, yielding the value of the inner query.

This method can be used to "flatten" nested queries.

Attributes

Source
ZQuery.scala
def fold[B](failure: E => B, success: A => B)(implicit ev: CanFail[E], trace: Trace): ZQuery[R, Nothing, B]

Folds over the failed or successful result of this query to yield a query that does not fail, but succeeds with the value returned by the left or right function passed to fold.

Folds over the failed or successful result of this query to yield a query that does not fail, but succeeds with the value returned by the left or right function passed to fold.

Attributes

Source
ZQuery.scala
def foldCauseQuery[R1 <: R, E1, B](failure: (Cause[E]) => ZQuery[R1, E1, B], success: A => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

A more powerful version of foldQuery that allows recovering from any type of failure except interruptions.

A more powerful version of foldQuery that allows recovering from any type of failure except interruptions.

Attributes

Source
ZQuery.scala
def foldCauseZIO[R1 <: R, E1, B](failure: (Cause[E]) => ZIO[R1, E1, B], success: A => ZIO[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

A more powerful version of foldZIO that allows recovering from any type of failure except interruptions.

A more powerful version of foldZIO that allows recovering from any type of failure except interruptions.

Attributes

Source
ZQuery.scala
def foldQuery[R1 <: R, E1, B](failure: E => ZQuery[R1, E1, B], success: A => ZQuery[R1, E1, B])(implicit ev: CanFail[E], trace: Trace): ZQuery[R1, E1, B]

Recovers from errors by accepting one query to execute for the case of an error, and one query to execute for the case of success.

Recovers from errors by accepting one query to execute for the case of an error, and one query to execute for the case of success.

Attributes

Source
ZQuery.scala
def foldZIO[R1 <: R, E1, B](failure: E => ZIO[R1, E1, B], success: A => ZIO[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

Recovers from errors by accepting one ZIO effect to execute for the case of an error, and one ZIO effect to execute for the case of success.

Recovers from errors by accepting one ZIO effect to execute for the case of an error, and one ZIO effect to execute for the case of success.

Attributes

Source
ZQuery.scala
def left[B, C](implicit ev: IsSubtypeOfOutput[A, Either[B, C]], trace: Trace): ZQuery[R, Either[E, C], B]

"Zooms in" on the value in the Left side of an Either, moving the possibility that the value is a Right to the error channel.

"Zooms in" on the value in the Left side of an Either, moving the possibility that the value is a Right to the error channel.

Attributes

Source
ZQuery.scala
def map[B](f: A => B)(implicit trace: Trace): ZQuery[R, E, B]

Maps the specified function over the successful result of this query.

Maps the specified function over the successful result of this query.

Attributes

Source
ZQuery.scala
def mapBoth[E1, B](f: E => E1, g: A => B)(implicit ev: CanFail[E], trace: Trace): ZQuery[R, E1, B]

Returns a query whose failure and success channels have been mapped by the specified pair of functions, f and g.

Returns a query whose failure and success channels have been mapped by the specified pair of functions, f and g.

Attributes

Source
ZQuery.scala
def mapBothCause[E1, B](f: (Cause[E]) => Cause[E1], g: A => B)(implicit ev: CanFail[E], trace: Trace): ZQuery[R, E1, B]

Returns a query whose failure cause and success channels have been mapped by the specified pair of functions, f and g.

Returns a query whose failure cause and success channels have been mapped by the specified pair of functions, f and g.

Attributes

Source
ZQuery.scala
def mapDataSources[R1 <: R](f: => DataSourceAspect[R1])(implicit trace: Trace): ZQuery[R1, E, A]

Transforms all data sources with the specified data source aspect.

Transforms all data sources with the specified data source aspect.

Attributes

Source
ZQuery.scala
def mapError[E1](f: E => E1)(implicit ev: CanFail[E], trace: Trace): ZQuery[R, E1, A]

Maps the specified function over the failed result of this query.

Maps the specified function over the failed result of this query.

Attributes

Source
ZQuery.scala
def mapErrorCause[E2](h: (Cause[E]) => Cause[E2])(implicit trace: Trace): ZQuery[R, E2, A]

Returns a query with its full cause of failure mapped using the specified function. This can be used to transform errors while preserving the original structure of Cause.

Returns a query with its full cause of failure mapped using the specified function. This can be used to transform errors while preserving the original structure of Cause.

Attributes

Source
ZQuery.scala
def mapZIO[R1 <: R, E1 >: E, B](f: A => ZIO[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

Maps the specified effectual function over the result of this query.

Maps the specified effectual function over the result of this query.

Attributes

Source
ZQuery.scala
def memoize(implicit trace: Trace): UIO[ZQuery[R, E, A]]

Returns an effect that, that if evaluated, will return a lazily computed version of this query

Returns an effect that, that if evaluated, will return a lazily computed version of this query

This differs from query caching, as caching will only cache the output of a DataSource. memoize will ensure that the query (including non-DataSource backed queries) is computed at-most-once.

This can beneficial for cases that a query is composed of multiple queries and it's reused multiple times, e.g.,

  case class Foo(x: UQuery[Int], y: UQuery[Int])
  val query: UQuery[Int] = ???

  // Query will be run exactly once; might not be necessary if `x` or `y` are not used afterwards
  query.map(i => Foo(ZQuery.succeed(i +1), ZQuery.succeed(i + 2)))

  // Query will be recomputed each time x or y are used
  Foo(query.map(_ + 1), query.map(_ + 2))

  // Query will be computed / run at-most-once
  query.memoize.map(q => Foo(q.map(_ + 1), q.map(_ + 2)))

Attributes

Source
ZQuery.scala
def optional(implicit trace: Trace): ZQuery[R, E, Option[A]]

Converts this query to one that returns Some if data sources return results for all requests received and None otherwise.

Converts this query to one that returns Some if data sources return results for all requests received and None otherwise.

Attributes

Source
ZQuery.scala
def orDie(implicit ev1: IsSubtypeOfError[E, Throwable], ev2: CanFail[E], trace: Trace): ZQuery[R, Nothing, A]

Converts this query to one that dies if a query failure occurs.

Converts this query to one that dies if a query failure occurs.

Attributes

Source
ZQuery.scala
def orDieWith(f: E => Throwable)(implicit ev: CanFail[E], trace: Trace): ZQuery[R, Nothing, A]

Converts this query to one that dies if a query failure occurs, using the specified function to map the error to a Throwable.

Converts this query to one that dies if a query failure occurs, using the specified function to map the error to a Throwable.

Attributes

Source
ZQuery.scala
def provideEnvironment(r: => Described[ZEnvironment[R]])(implicit trace: Trace): ZQuery[Any, E, A]

Provides this query with its required environment.

Provides this query with its required environment.

Attributes

Source
ZQuery.scala
def provideLayer[E1 >: E, R0](layer: => Described[ZLayer[R0, E1, R]])(implicit trace: Trace): ZQuery[R0, E1, A]

Provides a layer to this query, which translates it to another level.

Provides a layer to this query, which translates it to another level.

Attributes

Source
ZQuery.scala
def provideSomeEnvironment[R0](f: => Described[(ZEnvironment[R0]) => ZEnvironment[R]])(implicit trace: Trace): ZQuery[R0, E, A]

Provides this query with part of its required environment.

Provides this query with part of its required environment.

Attributes

Source
ZQuery.scala
def provideSomeLayer[R0]: ProvideSomeLayer[R0, R, E, A]

Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0.

Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0.

Attributes

Source
ZQuery.scala
def race[R1 <: R, E1 >: E, A1 >: A](that: => ZQuery[R1, E1, A1])(implicit trace: Trace): ZQuery[R1, E1, A1]

Races this query with the specified query, returning the result of the first to complete successfully and safely interrupting the other.

Races this query with the specified query, returning the result of the first to complete successfully and safely interrupting the other.

Attributes

Source
ZQuery.scala
def refineOrDie[E1](pf: PartialFunction[E, E1])(implicit ev1: IsSubtypeOfError[E, Throwable], ev2: CanFail[E], trace: Trace): ZQuery[R, E1, A]

Keeps some of the errors, and terminates the query with the rest

Keeps some of the errors, and terminates the query with the rest

Attributes

Source
ZQuery.scala
def refineOrDieWith[E1](pf: PartialFunction[E, E1])(f: E => Throwable)(implicit ev: CanFail[E], trace: Trace): ZQuery[R, E1, A]

Keeps some of the errors, and terminates the query with the rest, using the specified function to convert the E into a Throwable.

Keeps some of the errors, and terminates the query with the rest, using the specified function to convert the E into a Throwable.

Attributes

Source
ZQuery.scala
def right[B, C](implicit ev: IsSubtypeOfOutput[A, Either[B, C]], trace: Trace): ZQuery[R, Either[B, E], C]

"Zooms in" on the value in the Right side of an Either, moving the possibility that the value is a Left to the error channel.

"Zooms in" on the value in the Right side of an Either, moving the possibility that the value is a Left to the error channel.

Attributes

Source
ZQuery.scala
def run(implicit trace: Trace): ZIO[R, E, A]

Returns an effect that models executing this query.

Returns an effect that models executing this query.

Attributes

Source
ZQuery.scala
def runCache(cache: => Cache)(implicit trace: Trace): ZIO[R, E, A]

Returns an effect that models executing this query with the specified cache.

Returns an effect that models executing this query with the specified cache.

Attributes

Source
ZQuery.scala
def runLog(implicit trace: Trace): ZIO[R, E, (Cache, A)]

Returns an effect that models executing this query, returning the query result along with the cache.

Returns an effect that models executing this query, returning the query result along with the cache.

Attributes

Source
ZQuery.scala
def sandbox(implicit trace: Trace): ZQuery[R, Cause[E], A]

Expose the full cause of failure of this query

Expose the full cause of failure of this query

Attributes

Source
ZQuery.scala
def sandboxWith[R1 <: R, E2, B](f: (ZQuery[R1, Cause[E], A]) => ZQuery[R1, Cause[E2], B])(implicit trace: Trace): ZQuery[R1, E2, B]

Companion helper to sandbox. Allows recovery, and partial recovery, from errors and defects alike, as in:

Companion helper to sandbox. Allows recovery, and partial recovery, from errors and defects alike, as in:

Attributes

Source
ZQuery.scala
def some[B](implicit ev: IsSubtypeOfOutput[A, Option[B]], trace: Trace): ZQuery[R, Option[E], B]

Extracts a Some value into the value channel while moving the None into the error channel for easier composition

Extracts a Some value into the value channel while moving the None into the error channel for easier composition

Inverse of ZQuery.unoption

Attributes

Source
ZQuery.scala
def someOrElse[B](default: => B)(implicit ev: A <:< Option[B], trace: Trace): ZQuery[R, E, B]

Extracts the optional value or succeeds with the given 'default' value.

Extracts the optional value or succeeds with the given 'default' value.

Attributes

Source
ZQuery.scala
def someOrElseZIO[B, R1 <: R, E1 >: E](default: ZQuery[R1, E1, B])(implicit ev: A <:< Option[B], trace: Trace): ZQuery[R1, E1, B]

Extracts the optional value or executes the given 'default' query.

Extracts the optional value or executes the given 'default' query.

Attributes

Source
ZQuery.scala
def someOrFail[B, E1 >: E](e: => E1)(implicit ev: IsSubtypeOfOutput[A, Option[B]], trace: Trace): ZQuery[R, E1, B]

Extracts the optional value or fails with the given error e.

Extracts the optional value or fails with the given error e.

Attributes

Source
ZQuery.scala
def summarized[R1 <: R, E1 >: E, B, C](summary0: ZIO[R1, E1, B])(f: (B, B) => C)(implicit trace: Trace): ZQuery[R1, E1, (C, A)]

Summarizes a query by computing some value before and after execution, and then combining the values to produce a summary, together with the result of execution.

Summarizes a query by computing some value before and after execution, and then combining the values to produce a summary, together with the result of execution.

Attributes

Source
ZQuery.scala
def timed(implicit trace: Trace): ZQuery[R, E, (Duration, A)]

Returns a new query that executes this one and times the execution.

Returns a new query that executes this one and times the execution.

Attributes

Source
ZQuery.scala
def timeout(duration: => Duration)(implicit trace: Trace): ZQuery[R, E, Option[A]]

Returns an effect that will timeout this query, returning None if the timeout elapses before the query was completed.

Returns an effect that will timeout this query, returning None if the timeout elapses before the query was completed.

Attributes

Source
ZQuery.scala
def timeoutFail[E1 >: E](e: => E1)(duration: => Duration)(implicit trace: Trace): ZQuery[R, E1, A]

The same as timeout, but instead of producing a None in the event of timeout, it will produce the specified error.

The same as timeout, but instead of producing a None in the event of timeout, it will produce the specified error.

Attributes

Source
ZQuery.scala
def timeoutFailCause[E1 >: E](cause: => Cause[E1])(duration: => Duration)(implicit trace: Trace): ZQuery[R, E1, A]

The same as timeout, but instead of producing a None in the event of timeout, it will produce the specified failure.

The same as timeout, but instead of producing a None in the event of timeout, it will produce the specified failure.

Attributes

Source
ZQuery.scala
def timeoutTo[B](b: => B): TimeoutTo[R, E, A, B]

Returns a query that will timeout this query, returning either the default value if the timeout elapses before the query has completed or the result of applying the function f to the successful result of the query.

Returns a query that will timeout this query, returning either the default value if the timeout elapses before the query has completed or the result of applying the function f to the successful result of the query.

Attributes

Source
ZQuery.scala
def uncached(implicit trace: Trace): ZQuery[R, E, A]

Disables caching for this query.

Disables caching for this query.

Attributes

Source
ZQuery.scala
def unleft[E1, B](implicit ev: IsSubtypeOfError[E, Either[E1, B]], trace: Trace): ZQuery[R, E1, Either[A, B]]

Converts a ZQuery[R, Either[E, B], A] into a ZQuery[R, E, Either[A, B]]. The inverse of left.

Converts a ZQuery[R, Either[E, B], A] into a ZQuery[R, E, Either[A, B]]. The inverse of left.

Attributes

Source
ZQuery.scala
def unoption[E1](implicit ev: IsSubtypeOfError[E, Option[E1]], trace: Trace): ZQuery[R, E1, Option[A]]

Converts an option on errors into an option on values.

Converts an option on errors into an option on values.

Attributes

Source
ZQuery.scala
def unrefine[E1 >: E](pf: PartialFunction[Throwable, E1])(implicit trace: Trace): ZQuery[R, E1, A]

Takes some fiber failures and converts them into errors.

Takes some fiber failures and converts them into errors.

Attributes

Source
ZQuery.scala
def unrefineTo[E1 >: E : ClassTag](implicit evidence$1: ClassTag[E1], trace: Trace): ZQuery[R, E1, A]

Takes some fiber failures and converts them into errors.

Takes some fiber failures and converts them into errors.

Attributes

Source
ZQuery.scala
def unrefineWith[E1](pf: PartialFunction[Throwable, E1])(f: E => E1)(implicit trace: Trace): ZQuery[R, E1, A]

Takes some fiber failures and converts them into errors, using the specified function to convert the E into an E1.

Takes some fiber failures and converts them into errors, using the specified function to convert the E into an E1.

Attributes

Source
ZQuery.scala
def unright[E1, B](implicit ev: IsSubtypeOfError[E, Either[B, E1]], trace: Trace): ZQuery[R, E1, Either[B, A]]

Converts a ZQuery[R, Either[B, E], A] into a ZQuery[R, E, Either[B, A]]. The inverse of right.

Converts a ZQuery[R, Either[B, E], A] into a ZQuery[R, E, Either[B, A]]. The inverse of right.

Attributes

Source
ZQuery.scala
def withParallelism(n: => Int)(implicit trace: Trace): ZQuery[R, E, A]

Sets the parallelism for this query to the specified maximum number of fibers.

Sets the parallelism for this query to the specified maximum number of fibers.

Attributes

Source
ZQuery.scala
def withParallelismUnbounded(implicit trace: Trace): ZQuery[R, E, A]

Sets the parallelism for this query to the specified maximum number of fibers.

Sets the parallelism for this query to the specified maximum number of fibers.

Attributes

Source
ZQuery.scala
def zip[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: Trace): ZQuery[R1, E1, zippable.Out]

Returns a query that models the execution of this query and the specified query sequentially, combining their results into a tuple.

Returns a query that models the execution of this query and the specified query sequentially, combining their results into a tuple.

Attributes

Source
ZQuery.scala
def zipBatched[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: Trace): ZQuery[R1, E1, zippable.Out]

Returns a query that models the execution of this query and the specified query, batching requests to data sources and combining their results into a tuple.

Returns a query that models the execution of this query and the specified query, batching requests to data sources and combining their results into a tuple.

Attributes

Source
ZQuery.scala
def zipBatchedLeft[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, A]

Returns a query that models the execution of this query and the specified query, batching requests to data sources and returning the result of this query.

Returns a query that models the execution of this query and the specified query, batching requests to data sources and returning the result of this query.

Attributes

Source
ZQuery.scala
def zipBatchedRight[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

Returns a query that models the execution of this query and the specified query, batching requests to data sources and returning the result of the specified query.

Returns a query that models the execution of this query and the specified query, batching requests to data sources and returning the result of the specified query.

Attributes

Source
ZQuery.scala
def zipLeft[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, A]

Returns a query that models the execution of this query and the specified query sequentially, returning the result of this query.

Returns a query that models the execution of this query and the specified query sequentially, returning the result of this query.

Attributes

Source
ZQuery.scala
def zipPar[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: Trace): ZQuery[R1, E1, zippable.Out]

Returns a query that models the execution of this query and the specified query in parallel, combining their results into a tuple.

Returns a query that models the execution of this query and the specified query in parallel, combining their results into a tuple.

Attributes

Source
ZQuery.scala
def zipParLeft[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, A]

Returns a query that models the execution of this query and the specified query in parallel, returning the result of this query.

Returns a query that models the execution of this query and the specified query in parallel, returning the result of this query.

Attributes

Source
ZQuery.scala
def zipParRight[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

Returns a query that models the execution of this query and the specified query in parallel, returning the result of the specified query.

Returns a query that models the execution of this query and the specified query in parallel, returning the result of the specified query.

Attributes

Source
ZQuery.scala
def zipRight[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

Returns a query that models the execution of this query and the specified query sequentially, returning the result of the specified query.

Returns a query that models the execution of this query and the specified query sequentially, returning the result of the specified query.

Attributes

Source
ZQuery.scala
def zipWith[R1 <: R, E1 >: E, B, C](that: => ZQuery[R1, E1, B])(f: (A, B) => C)(implicit trace: Trace): ZQuery[R1, E1, C]

Returns a query that models the execution of this query and the specified query sequentially, combining their results with the specified function. Requests composed with zipWith or combinators derived from it will automatically be pipelined.

Returns a query that models the execution of this query and the specified query sequentially, combining their results with the specified function. Requests composed with zipWith or combinators derived from it will automatically be pipelined.

Attributes

Source
ZQuery.scala
def zipWithBatched[R1 <: R, E1 >: E, B, C](that: => ZQuery[R1, E1, B])(f: (A, B) => C)(implicit trace: Trace): ZQuery[R1, E1, C]

Returns a query that models the execution of this query and the specified query, batching requests to data sources.

Returns a query that models the execution of this query and the specified query, batching requests to data sources.

Attributes

Source
ZQuery.scala
def zipWithPar[R1 <: R, E1 >: E, B, C](that: => ZQuery[R1, E1, B])(f: (A, B) => C)(implicit trace: Trace): ZQuery[R1, E1, C]

Returns a query that models the execution of this query and the specified query in parallel, combining their results with the specified function. Requests composed with zipWithPar or combinators derived from it will automatically be batched.

Returns a query that models the execution of this query and the specified query in parallel, combining their results with the specified function. Requests composed with zipWithPar or combinators derived from it will automatically be batched.

Attributes

Source
ZQuery.scala
def ~>[R1 <: R, E1 >: E, B](that: => ZQuery[R1, E1, B])(implicit trace: Trace): ZQuery[R1, E1, B]

A symbolic alias for zipBatchedRight.

A symbolic alias for zipBatchedRight.

Attributes

Source
ZQuery.scala