Class/Object

zio.query

ZQuery

Related Docs: object ZQuery | package query

Permalink

final class ZQuery[-R, +E, +A] extends AnyRef

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

Self Type
ZQuery[R, E, A]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZQuery
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def &>[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

    A symbolic alias for zipParRight.

  4. final def *>[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

    A symbolic alias for zipRight.

  5. final def <&[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, A]

    Permalink

    A symbolic alias for zipParLeft.

  6. final def <&>[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): ZQuery[R1, E1, Out]

    Permalink

    A symbolic alias for zipPar.

  7. final def <*[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, A]

    Permalink

    A symbolic alias for zipLeft.

  8. final def <*>[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): ZQuery[R1, E1, Out]

    Permalink

    A symbolic alias for zip.

  9. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. final def @@[R1 <: R](aspect: ⇒ DataSourceAspect[R1])(implicit trace: ZTraceElement): ZQuery[R1, E, A]

    Permalink

    Syntax for adding aspects.

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

    Permalink

    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

  12. final def as[B](b: ⇒ B)(implicit trace: ZTraceElement): ZQuery[R, E, B]

    Permalink

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

  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def asSomeError(implicit trace: ZTraceElement): ZQuery[R, Option[E], A]

    Permalink

    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

    See also

    ZQuery.some

  15. def cached(implicit trace: ZTraceElement): ZQuery[R, E, A]

    Permalink

    Enables caching for this query.

    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.

  16. def catchAll[R1 <: R, E2, A1 >: A](h: (E) ⇒ ZQuery[R1, E2, A1])(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R1, E2, A1]

    Permalink

    Recovers from all errors.

  17. def catchAllCause[R1 <: R, E2, A1 >: A](h: (Cause[E]) ⇒ ZQuery[R1, E2, A1])(implicit trace: ZTraceElement): ZQuery[R1, E2, A1]

    Permalink

    Recovers from all errors with provided Cause.

    Recovers from all errors with provided Cause.

    See also

    ZQuery.sandbox - other functions that can recover from defects

  18. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def either(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R, Nothing, Either[E, A]]

    Permalink

    Returns a query whose failure and success have been lifted into an Either.

    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.

  20. final def ensuring[R1 <: R](finalizer: ⇒ ZQuery[R1, Nothing, Any])(implicit trace: ZTraceElement): ZQuery[R1, E, A]

    Permalink

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

  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. final def flatMap[R1 <: R, E1 >: E, B](f: (A) ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

    Returns a query that models execution of this query, followed by passing its result to the specified function that returns a query.

    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.

  25. final def flatten[R1 <: R, E1 >: E, B](implicit ev: IsSubtypeOfOutput[A, ZQuery[R1, E1, B]], trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

    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.

  26. final def fold[B](failure: (E) ⇒ B, success: (A) ⇒ B)(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R, Nothing, B]

    Permalink

    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.

  27. final def foldCauseQuery[R1 <: R, E1, B](failure: (Cause[E]) ⇒ ZQuery[R1, E1, B], success: (A) ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

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

  28. final def foldQuery[R1 <: R, E1, B](failure: (E) ⇒ ZQuery[R1, E1, B], success: (A) ⇒ ZQuery[R1, E1, B])(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

    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.

  29. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. final def left[B, C](implicit ev: IsSubtypeOfOutput[A, Either[B, C]], trace: ZTraceElement): ZQuery[R, Either[E, C], B]

    Permalink

    "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.

  33. final def map[B](f: (A) ⇒ B)(implicit trace: ZTraceElement): ZQuery[R, E, B]

    Permalink

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

  34. final def mapBoth[E1, B](f: (E) ⇒ E1, g: (A) ⇒ B)(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R, E1, B]

    Permalink

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

  35. final def mapDataSources[R1 <: R](f: ⇒ DataSourceAspect[R1])(implicit trace: ZTraceElement): ZQuery[R1, E, A]

    Permalink

    Transforms all data sources with the specified data source aspect.

  36. final def mapError[E1](f: (E) ⇒ E1)(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R, E1, A]

    Permalink

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

  37. def mapErrorCause[E2](h: (Cause[E]) ⇒ Cause[E2])(implicit trace: ZTraceElement): ZQuery[R, E2, A]

    Permalink

    Returns a query with its full cause of failure mapped using the specified function.

    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.

    See also

    sandbox, catchAllCause - other functions for dealing with defects

  38. final def mapZIO[R1 <: R, E1 >: E, B](f: (A) ⇒ ZIO[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

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

  39. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  40. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. final def optional(implicit trace: ZTraceElement): ZQuery[R, E, Option[A]]

    Permalink

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

  43. final def orDie(implicit ev1: IsSubtypeOfError[E, Throwable], ev2: CanFail[E], trace: ZTraceElement): ZQuery[R, Nothing, A]

    Permalink

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

  44. final def orDieWith(f: (E) ⇒ Throwable)(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R, Nothing, A]

    Permalink

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

  45. final def provideCustomLayer[E1 >: E, R1](layer: ⇒ Described[ZLayer[ZEnv, E1, R1]])(implicit ev: <:<[ZEnv with R1, R], tag: zio.Tag[R1], trace: ZTraceElement): ZQuery[ZEnv, E1, A]

    Permalink

    Provides the part of the environment that is not part of the ZEnv, leaving a query that only depends on the ZEnv.

  46. final def provideEnvironment(r: ⇒ Described[ZEnvironment[R]])(implicit ev: NeedsEnv[R], trace: ZTraceElement): ZQuery[Any, E, A]

    Permalink

    Provides this query with its required environment.

  47. final def provideLayer[E1 >: E, R0](layer: ⇒ Described[ZLayer[R0, E1, R]])(implicit ev: NeedsEnv[R], trace: ZTraceElement): ZQuery[R0, E1, A]

    Permalink

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

  48. final def provideSomeEnvironment[R0](f: ⇒ Described[(ZEnvironment[R0]) ⇒ ZEnvironment[R]])(implicit ev: NeedsEnv[R], trace: ZTraceElement): ZQuery[R0, E, A]

    Permalink

    Provides this query with part of its required environment.

  49. final def provideSomeLayer[R0]: ProvideSomeLayer[R0, R, E, A]

    Permalink

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

  50. def race[R1 <: R, E1 >: E, A1 >: A](that: ⇒ ZQuery[R1, E1, A1])(implicit trace: ZTraceElement): ZQuery[R1, E1, A1]

    Permalink

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

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

    Permalink

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

  52. def refineOrDieWith[E1](pf: PartialFunction[E, E1])(f: (E) ⇒ Throwable)(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R, E1, A]

    Permalink

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

  53. final def right[B, C](implicit ev: IsSubtypeOfOutput[A, Either[B, C]], trace: ZTraceElement): ZQuery[R, Either[B, E], C]

    Permalink

    "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.

  54. final def run(implicit trace: ZTraceElement): ZIO[R, E, A]

    Permalink

    Returns an effect that models executing this query.

  55. final def runCache(cache: ⇒ Cache)(implicit trace: ZTraceElement): ZIO[R, E, A]

    Permalink

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

  56. final def runLog(implicit trace: ZTraceElement): ZIO[R, E, (Cache, A)]

    Permalink

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

  57. def sandbox(implicit trace: ZTraceElement): ZQuery[R, Cause[E], A]

    Permalink

    Expose the full cause of failure of this query

  58. def sandboxWith[R1 <: R, E2, B](f: (ZQuery[R1, Cause[E], A]) ⇒ ZQuery[R1, Cause[E2], B])(implicit trace: ZTraceElement): ZQuery[R1, E2, B]

    Permalink

    Companion helper to sandbox.

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

  59. def some[B](implicit ev: IsSubtypeOfOutput[A, Option[B]], trace: ZTraceElement): ZQuery[R, Option[E], B]

    Permalink

    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

  60. def someOrElse[B](default: ⇒ B)(implicit ev: <:<[A, Option[B]], trace: ZTraceElement): ZQuery[R, E, B]

    Permalink

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

  61. final def someOrElseZIO[B, R1 <: R, E1 >: E](default: ZQuery[R1, E1, B])(implicit ev: <:<[A, Option[B]], trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

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

  62. final def someOrFail[B, E1 >: E](e: ⇒ E1)(implicit ev: IsSubtypeOfOutput[A, Option[B]], trace: ZTraceElement): ZQuery[R, E1, B]

    Permalink

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

  63. final def summarized[R1 <: R, E1 >: E, B, C](summary0: ZIO[R1, E1, B])(f: (B, B) ⇒ C)(implicit trace: ZTraceElement): ZQuery[R1, E1, (C, A)]

    Permalink

    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.

  64. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  65. final def timed(implicit trace: ZTraceElement): ZQuery[R with Clock, E, (zio.Duration, A)]

    Permalink

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

  66. final def timeout(duration: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZQuery[R with Clock, E, Option[A]]

    Permalink

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

  67. final def timeoutFail[E1 >: E](e: ⇒ E1)(duration: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZQuery[R with Clock, E1, A]

    Permalink

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

  68. final def timeoutFailCause[E1 >: E](cause: ⇒ Cause[E1])(duration: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZQuery[R with Clock, E1, A]

    Permalink

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

  69. final def timeoutTo[B](b: ⇒ B): TimeoutTo[R, E, A, B]

    Permalink

    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.

  70. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  71. def uncached(implicit trace: ZTraceElement): ZQuery[R, E, A]

    Permalink

    Disables caching for this query.

  72. final def unleft[E1, B](implicit ev: IsSubtypeOfError[E, Either[E1, B]], trace: ZTraceElement): ZQuery[R, E1, Either[A, B]]

    Permalink

    Converts a ZQuery[R, Either[E, B], A] into a ZQuery[R, E, Either[A, B]].

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

  73. final def unoption[E1](implicit ev: IsSubtypeOfError[E, Option[E1]], trace: ZTraceElement): ZQuery[R, E1, Option[A]]

    Permalink

    Converts an option on errors into an option on values.

  74. final def unrefine[E1 >: E](pf: PartialFunction[Throwable, E1])(implicit trace: ZTraceElement): ZQuery[R, E1, A]

    Permalink

    Takes some fiber failures and converts them into errors.

  75. final def unrefineTo[E1 >: E](implicit arg0: ClassTag[E1], trace: ZTraceElement): ZQuery[R, E1, A]

    Permalink

    Takes some fiber failures and converts them into errors.

  76. final def unrefineWith[E1](pf: PartialFunction[Throwable, E1])(f: (E) ⇒ E1)(implicit trace: ZTraceElement): ZQuery[R, E1, A]

    Permalink

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

  77. final def unright[E1, B](implicit ev: IsSubtypeOfError[E, Either[B, E1]], trace: ZTraceElement): ZQuery[R, E1, Either[B, A]]

    Permalink

    Converts a ZQuery[R, Either[B, E], A] into a ZQuery[R, E, Either[B, A]].

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

  78. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  80. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  81. final def zip[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): ZQuery[R1, E1, Out]

    Permalink

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

  82. final def zipBatched[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): ZQuery[R1, E1, Out]

    Permalink

    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.

  83. final def zipBatchedLeft[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, A]

    Permalink

    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.

  84. final def zipBatchedRight[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

    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.

  85. final def zipLeft[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, A]

    Permalink

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

  86. final def zipPar[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): ZQuery[R1, E1, Out]

    Permalink

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

  87. final def zipParLeft[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, A]

    Permalink

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

  88. final def zipParRight[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

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

  89. final def zipRight[R1 <: R, E1 >: E, B](that: ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

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

  90. final def zipWith[R1 <: R, E1 >: E, B, C](that: ⇒ ZQuery[R1, E1, B])(f: (A, B) ⇒ C)(implicit trace: ZTraceElement): ZQuery[R1, E1, C]

    Permalink

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

    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.

  91. final def zipWithBatched[R1 <: R, E1 >: E, B, C](that: ⇒ ZQuery[R1, E1, B])(f: (A, B) ⇒ C)(implicit trace: ZTraceElement): ZQuery[R1, E1, C]

    Permalink

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

  92. final def zipWithPar[R1 <: R, E1 >: E, B, C](that: ⇒ ZQuery[R1, E1, B])(f: (A, B) ⇒ C)(implicit trace: ZTraceElement): ZQuery[R1, E1, C]

    Permalink

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

    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.

Deprecated Value Members

  1. final def >>=[R1 <: R, E1 >: E, B](f: (A) ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

    A symbolic alias for flatMap.

    A symbolic alias for flatMap.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) use flatMap

  2. final def bimap[E1, B](f: (E) ⇒ E1, g: (A) ⇒ B)(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R, E1, B]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) use mapBoth

  3. def collectSome[E1](implicit ev: IsSubtypeOfError[E, Option[E1]], trace: ZTraceElement): ZQuery[R, E1, Option[A]]

    Permalink

    Moves a None value in the error channel into the value channel while converting the existing value into a Some

    Moves a None value in the error channel into the value channel while converting the existing value into a Some

    Inverse of ZQuery.some

    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) use unoption

  4. final def foldCauseM[R1 <: R, E1, B](failure: (Cause[E]) ⇒ ZQuery[R1, E1, B], success: (A) ⇒ ZQuery[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) use foldCauseQuery

  5. final def foldM[R1 <: R, E1, B](failure: (E) ⇒ ZQuery[R1, E1, B], success: (A) ⇒ ZQuery[R1, E1, B])(implicit ev: CanFail[E], trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) use foldQuery

  6. final def mapM[R1 <: R, E1 >: E, B](f: (A) ⇒ ZIO[R1, E1, B])(implicit trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) use mapQuery

  7. final def someOrElseM[B, R1 <: R, E1 >: E](default: ZQuery[R1, E1, B])(implicit ev: <:<[A, Option[B]], trace: ZTraceElement): ZQuery[R1, E1, B]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) use someOrElseZIO

  8. final def timeoutHalt[E1 >: E](cause: ⇒ Cause[E1])(duration: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZQuery[R with Clock, E1, A]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) use timeoutFailCause

Inherited from AnyRef

Inherited from Any

Ungrouped