c

slick.compiler

MergeToComprehensions

class MergeToComprehensions extends Phase

This phase merges nested nodes of types Bind, Filter, GroupBy, SortBy, Take, Drop, CollectionCast and Distinct to Comprehension nodes. Nodes can be merged if they occur in the following order:

[Source] -> Filter (where) -> GroupBy -> SortBy / (Distinct | Filter (having)) -> Take / Drop

Aliasing Binds and CollectionCasts are allowed everywhere in the chain. Any out of order operation starts a new chain with a subquery as the source.

Source
MergeToComprehensions.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MergeToComprehensions
  2. Phase
  3. Logging
  4. Function1
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MergeToComprehensions()

Type Members

  1. type Mappings = ConstArray[((TypeSymbol, TermSymbol), List[TermSymbol])]
  2. type Replacements = Map[(TypeSymbol, TermSymbol), TermSymbol]

    A map from a TypeSymbol and a field on top of it to a new Symbol

  3. abstract type State

    The immutable state of the phase that can also be accessed by other phases.

    The immutable state of the phase that can also be accessed by other phases.

    Definition Classes
    Phase

Value Members

  1. def and(p1: Node, p2: Node): Node
  2. def andThen[A](g: (CompilerState) => A): (CompilerState) => A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  3. def apply(state: CompilerState): CompilerState

    Run the phase

    Run the phase

    Definition Classes
    MergeToComprehensionsPhase → Function1
  4. def applyReplacements(n1: Node, r: Replacements, c: Comprehension[Option[Node]]): Node

    Apply the replacements and current selection of a Comprehension to a new Node that will be merged into the Comprehension.

  5. def buildSubquery(n: Node, mappings: Mappings): (Base, Replacements)

    Lift a valid top-level or source Node into a subquery

  6. def compose[A](g: (A) => CompilerState): (A) => CompilerState
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  7. def convert(tree: Node): Node
  8. def dealias(n: Node)(f: (Node) => (Node, Mappings)): (Node, Mappings)

    Remove purely aliasing Bind mappings, apply the conversion to the source, then inject the mappings back into the source's mappings.

  9. def mergeCommon(rec: (Node, Boolean) => (Base, Replacements), parent: (Node, Boolean) => (Base, Replacements), n: Node, buildBase: Boolean, allowFilter: Boolean = true): (Base, Replacements)

    Merge the common operations Bind, Filter and CollectionCast into an existing Comprehension.

    Merge the common operations Bind, Filter and CollectionCast into an existing Comprehension. This method is used at different stages of the pipeline. If the Comprehension already contains a Distinct clause, it is pushed into a subquery.

  10. val name: String

    The unique name of the phase

    The unique name of the phase

    Definition Classes
    MergeToComprehensionsPhase
  11. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  12. def toSubquery(n: Base, r: Replacements): (Base, Replacements)
  13. object FwdPathOnTypeSymbol