Trait/Object

zio.zquery

DataSource

Related Docs: object DataSource | package zquery

Permalink

trait DataSource[-R, -A] extends AnyRef

A DataSource[R, A] is capable of executing requests of type A that require an environment R.

Data sources must implement the method run which takes a collection of requests and returns an effect with a CompletedRequestMap containing a mapping from requests to results. Because run is parameterized on a collection of requests rather than a single request, data sources have the ability to introspect on all the requests being executed in parallel and optimize the query.

Data sources will typically be parameterized on a subtype of Request[A], though that is not strictly necessarily as long as the data source can map the request type to a Request[A]. Data sources can then pattern match on the collection of requests to determine the information requested, execute the query, and place the results into the CompletedRequestsMap using CompletedRequestMap.empty and CompletedRequestMap.insert. Data sources must provide results for all requests received. Failure to do so will cause a query to die with a QueryFailure when run.

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

Abstract Value Members

  1. abstract val identifier: String

    Permalink

    The data source's identifier.

  2. abstract def run(requests: Iterable[A]): ZIO[R, Nothing, CompletedRequestMap]

    Permalink

    Execute a collection of requests.

    Execute a collection of requests. Data sources are guaranteed that the collection will contain at least one request and that all requests will be unique when they are called by ZQuery.

Concrete 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 ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def contramap[B](f: Described[(B) ⇒ A]): DataSource[R, B]

    Permalink

    Returns a new data source that executes requests of type B using the specified function to transform B requests into requests that this data source can execute.

  7. final def contramapM[R1 <: R, B](f: Described[(B) ⇒ ZIO[R1, Nothing, A]]): DataSource[R1, B]

    Permalink

    Returns a new data source that executes requests of type B using the specified effectual function to transform B requests into requests that this data source can execute.

  8. final def eitherWith[R1 <: R, B, C](that: DataSource[R1, B])(f: Described[(C) ⇒ Either[A, B]]): DataSource[R1, C]

    Permalink

    Returns a new data source that executes requests of type C using the specified function to transform C requests into requests that either this data source or that data source can execute.

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

    Permalink
    Definition Classes
    AnyRef
  10. final def equals(that: Any): Boolean

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  18. final def provide(r: Described[R])(implicit ev: NeedsEnv[R]): DataSource[Any, A]

    Permalink

    Provides this data source with its required environment.

  19. final def provideSome[R0](f: Described[(R0) ⇒ R])(implicit ev: NeedsEnv[R]): DataSource[R0, A]

    Permalink

    Provides this data source with part of its required environment.

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

    Permalink
    Definition Classes
    AnyRef
  21. final def toString(): String

    Permalink
    Definition Classes
    DataSource → AnyRef → Any
  22. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped