Packages

sealed abstract class Query[-In, +Out] extends Serializable

Query is a description of computations you want to perform on your data. It doesn't evaluate until you explicitly run it.

In

query input, e.g. type of the data source

Out

query computation result type

Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Query
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def explain: QueryExplain

    Provides information about the query "plan".

    Provides information about the query "plan".

    returns

    the query plain

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ++[In2 <: In, Out0 >: Out](that: Query[In2, Out0])(implicit arg0: scalaql.Tag[In2], arg1: scalaql.Tag[Out0]): Query[In2, Out0]

    Symbolic alias for union

    Symbolic alias for union

    See also

    union

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def >>>[Out0 >: Out, Out2](that: Query[From[Out0], Out2])(implicit arg0: scalaql.Tag[Out0], arg1: scalaql.Tag[Out2]): Query[In, Out2]

    Symbolic alias for andThen

    Symbolic alias for andThen

    See also

    andThen

  6. def accumulate[S, B](initialState: S)(modifyState: (S, Out) => S)(getResults: (S) => Iterable[B])(implicit arg0: scalaql.Tag[S], arg1: scalaql.Tag[B]): Query[In, B]

    Accumulates all of the query values into a state, producing records based on that state.

    Accumulates all of the query values into a state, producing records based on that state.

    S

    accumulation state type

    B

    accumulation result type

    initialState

    the initial state for accumulation

    modifyState

    updates state by applying query output value

    getResults

    extract records from the state

    returns

    transformed query

    Note

    should be used only for complicated computations if no equivalent exist. Accumulating query emits value only after processing the whole input! Example:

    val uniqueSkills = select[Person]
      .accumulate(initialState = Set.empty[Skill])(
        (skillSet, person) =>
          skillSet ++ person.skills
      )(_.toList)
  7. def andThen[Out0 >: Out, Out2](that: Query[From[Out0], Out2])(implicit arg0: scalaql.Tag[Out0], arg1: scalaql.Tag[Out2]): Query[In, Out2]

    Produces a query which uses this query input by producing output of the specified query.

    Produces a query which uses this query input by producing output of the specified query. Allows functional composition of multiple queries.

    Example:

    val peopleSkills = select[Person].mapConcat(_.skills).distinct
    
    val programmingSkills = select[Skill].where(_.isProgrammingSkill)
    
    val result = peopleSkills >>> programmingSkills
    Out0

    inferred common output type for this query and the transformed result query

    Out2

    new query output type

    that

    query for which to feed this query output

    returns

    a composition of this and that query

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. def collect[B](pf: PartialFunction[Out, B])(implicit arg0: scalaql.Tag[B]): Query[In, B]

    Transforms the query output by applying an arbitrary partial function to previous query step.

    Transforms the query output by applying an arbitrary partial function to previous query step.

    Used to apply transformation and filtering in one step.

    Example:

    select[Person].collect {
      case person if person.age >= 18 =>
        person.name
    }
    B

    new query output type

    pf

    transformation function

    returns

    transformed query

  11. def deduplicate: Query[In, Out]

    Produces only unique values.

    Produces only unique values.

    returns

    the same query with only unique values

    See also

    deduplicateBy

  12. def deduplicateBy[K](f: (Out) => K)(implicit arg0: scalaql.Tag[K]): Query[In, Out]

    Produces only unique values based on the given deduplication key.

    Produces only unique values based on the given deduplication key.

    Example:

    select[Person].deduplicateBy(_.name)
    K

    deduplication key type

    f

    extracts deduplication key

    returns

    the same query with only unique values

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. def flatMap[In2 <: In, B](f: (Out) => Query[In2, B])(implicit arg0: scalaql.Tag[In2], arg1: scalaql.Tag[B]): Query[In2, B]

    Transforms the query output by applying an arbitrary function which produces a new Query based on the previous step.

    Transforms the query output by applying an arbitrary function which produces a new Query based on the previous step.

    Example:

    select[Employee]
      .flatMap { employee =>
        select[Skill].where(_.name isInCollection employee.skills)
      }
    In2

    inferred common input type for this query and the transformed result query

    B

    new query output type

    f

    transformation function

    returns

    transformed query

  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def groupBy[A, B, C](f: scalaql.GroupBy[Out, A], g: scalaql.GroupBy[Out, B], h: scalaql.GroupBy[Out, C])(implicit arg0: scalaql.Tag[A], arg1: scalaql.Tag[B], arg2: scalaql.Tag[C]): GroupByQuery[In, Out, (A, B, C)]

    Entrypoint for performing aggregations on this query.

    Entrypoint for performing aggregations on this query.

    A

    the first grouping key type

    B

    the second grouping key type

    C

    the third grouping key type

    f

    extracts the first grouping key

    g

    extracts the second grouping key

    h

    extracts the third grouping key

  19. def groupBy[A, B](f: scalaql.GroupBy[Out, A], g: scalaql.GroupBy[Out, B])(implicit arg0: scalaql.Tag[A], arg1: scalaql.Tag[B]): GroupByQuery[In, Out, (A, B)]

    Entrypoint for performing aggregations on this query.

    Entrypoint for performing aggregations on this query.

    A

    the first grouping key type

    B

    the second grouping key type

    f

    extracts the first grouping key

    g

    extracts the second grouping key

  20. def groupBy[A](f: scalaql.GroupBy[Out, A])(implicit arg0: scalaql.Tag[A]): GroupByQuery[In, Out, A]

    Entrypoint for performing aggregations on this query.

    Entrypoint for performing aggregations on this query.

    A

    grouping key type

    f

    extracts grouping key

  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def map[B](f: (Out) => B)(implicit arg0: scalaql.Tag[B]): Query[In, B]

    Transforms the query output by applying an arbitrary function to previous query step.

    Transforms the query output by applying an arbitrary function to previous query step.

    Example:

    select[Person].map(_.age)
    B

    new query output type

    f

    transformation function

    returns

    transformed query

  24. def mapConcat[B](f: (Out) => Iterable[B])(implicit arg0: scalaql.Tag[B]): Query[In, B]

    Transforms the query output by applying an arbitrary function to previous query step.

    Transforms the query output by applying an arbitrary function to previous query step.

    Unlike map, expects a transformation which produces multiple results.

    Example:

    select[Employee].mapConcat(_.skills)
    B

    new query output type

    f

    transformation function

    returns

    transformed query

  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. def statefulMap[S, B](initialState: S)(process: (S, Out) => (S, B))(implicit arg0: scalaql.Tag[S], arg1: scalaql.Tag[B]): Query[In, B]

    Transforms the query output by applying an arbitrary stateful function to previous query step.

    Transforms the query output by applying an arbitrary stateful function to previous query step.

    Unlike map, each output value depends on previously computed state.

    S

    accumulation state type

    B

    accumulation result type

    initialState

    the initial state for accumulation

    process

    computes output value based on the input value and state

    returns

    transformed query

  29. def statefulMapConcat[S, B](initialState: S)(process: (S, Out) => (S, Iterable[B]))(implicit arg0: scalaql.Tag[S], arg1: scalaql.Tag[B]): Query[In, B]

    Transforms the query output by applying an arbitrary stateful function to previous query step.

    Transforms the query output by applying an arbitrary stateful function to previous query step.

    Unlike statefulMap, expects a stateful transformation which produces multiple results.

    S

    accumulation state type

    B

    accumulation result type

    initialState

    the initial state for accumulation

    process

    computes output value based on the input value and state

    returns

    transformed query

  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. final def toString(): String
    Definition Classes
    Query → AnyRef → Any
  32. def union[In2 <: In, Out0 >: Out](that: Query[In2, Out0])(implicit arg0: scalaql.Tag[In2], arg1: scalaql.Tag[Out0]): Query[In2, Out0]

    Produces a query which emits results from both this and the specified new query.

    Produces a query which emits results from both this and the specified new query.

    In2

    inferred common input type for this query and the transformed result query

    Out0

    inferred common output type for this query and the transformed result query

    that

    query to union with

    returns

    union of this and that query

    Note

    the current implementation of union first produces all the results of this query, and then results of the specified query. But this behavior may change in future

  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  36. def where(p: scalaql.Predicate[Out]): Query[In, Out]

    Filters records by specified predicate function.

    Filters records by specified predicate function.

    Example:

    select[Person].where(_.age >= 18)
    p

    predicate

    returns

    query producing only elements for which the given predicate holds

  37. def whereNot(p: scalaql.Predicate[Out]): Query[In, Out]

    An equivalent where(!p).

    An equivalent where(!p).

    See also

    where

  38. def whereSubQuery[In2 <: In](p: (Out) => QueryResult[In2, Boolean])(implicit arg0: scalaql.Tag[In2]): Query[In2, Out]

    Filters records by a predicate which depends on the result of other query.

    Filters records by a predicate which depends on the result of other query.

    Example:

    select[Person]
      .whereSubQuery(person =>
        select[Employee].exists(_.personId == person.id)
      )
    In2

    inferred common input type for this query and the transformed result query

    p

    predicate

    returns

    query producing only elements for which the given predicate holds

  39. def withFilter(p: scalaql.Predicate[Out]): Query[In, Out]

    See also

    where

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped