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.
- Alphabetic
- By Inheritance
- MergeToComprehensions
- Phase
- Logging
- Function1
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new MergeToComprehensions()
Type Members
- type Mappings = ConstArray[((TypeSymbol, TermSymbol), List[TermSymbol])]
- type Replacements = Map[(TypeSymbol, TermSymbol), TermSymbol]
A map from a TypeSymbol and a field on top of it to a new Symbol
- 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
- def and(p1: Node, p2: Node): Node
- def andThen[A](g: (CompilerState) => A): (CompilerState) => A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def apply(state: CompilerState): CompilerState
Run the phase
Run the phase
- Definition Classes
- MergeToComprehensions → Phase → Function1
- 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.
- def buildSubquery(n: Node, mappings: Mappings): (Base, Replacements)
Lift a valid top-level or source Node into a subquery
- def compose[A](g: (A) => CompilerState): (A) => CompilerState
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def convert(tree: Node): Node
- 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. - 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.
- val name: String
The unique name of the phase
The unique name of the phase
- Definition Classes
- MergeToComprehensions → Phase
- def toString(): String
- Definition Classes
- Function1 → AnyRef → Any
- def toSubquery(n: Base, r: Replacements): (Base, Replacements)
- object FwdPathOnTypeSymbol
edit this text on github
Scala Language-Integrated Connection Kit
This is the API documentation for the Slick database library. It should be used as an additional resource to the user manual.
Further documentation for Slick can be found on the documentation pages.
To the slick package list...