package ast
Abstract Syntax Tree (AST) for representing queries during compilation
- Source
- package.scala
- Alphabetic
- By Inheritance
- ast
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class Aggregate(sym: TermSymbol, from: Node, select: Node) extends BinaryNode with DefNode with Product with Serializable
An aggregation function application which is similar to a Bind(_, _, Pure(_)) where the projection contains a mapping function application.
An aggregation function application which is similar to a Bind(_, _, Pure(_)) where the projection contains a mapping function application. The return type is an aggregated scalar value though, not a collection.
- class AnonSymbol extends TermSymbol
An anonymous symbol defined in the AST.
- class AnonTableIdentitySymbol extends AnonTypeSymbol with TableIdentitySymbol
An anonymous TableIdentitySymbol.
- class AnonTypeSymbol extends TypeSymbol
An anonymous symbol defined in the AST.
- final case class Apply(sym: TermSymbol, children: ConstArray[Node])(buildType: Type) extends SimplyTypedNode with Product with Serializable
A function call expression.
- trait AtomicType extends Type
An atomic type (i.e.
An atomic type (i.e. a type which does not contain other types)
- trait BaseTypedType[T] extends TypedType[T] with AtomicType
- trait BinaryNode extends Node
- final case class Bind(generator: TermSymbol, from: Node, select: Node) extends BinaryNode with DefNode with Product with Serializable
A .flatMap call of type (CollectionType(c, _), CollectionType(_, u)) => CollectionType(c, u).
- trait ClientSideOp extends AnyRef
An operation which is expected to be run on the client side.
- final case class CollectionCast(child: Node, cons: CollectionTypeConstructor) extends UnaryNode with SimplyTypedNode with Product with Serializable
- final case class CollectionType(cons: CollectionTypeConstructor, elementType: Type) extends Type with Product with Serializable
- trait CollectionTypeConstructor extends AnyRef
Represents a type constructor that can be usd for a collection-valued query.
Represents a type constructor that can be usd for a collection-valued query. The relevant information for Slick is whether the elements of the collection keep their insertion order (isSequential) and whether only distinct elements are allowed (isUnique).
- abstract class ColumnOption[+T] extends AnyRef
- final case class CompiledStatement(statement: String, extra: Any, buildType: Type) extends NullaryNode with SimplyTypedNode with Product with Serializable
A compiled statement with a fixed type, a statement string and profile-specific extra data.
- abstract class ComplexFilteredQuery extends FilteredQuery with DefNode
A FilteredQuery with a Symbol.
- final case class Comprehension(sym: TermSymbol, from: Node, select: Node, where: Option[Node] = None, groupBy: Option[Node] = None, orderBy: ConstArray[(Node, Ordering)] = ConstArray.empty, having: Option[Node] = None, distinct: Option[Node] = None, fetch: Option[Node] = None, offset: Option[Node] = None, forUpdate: Boolean = false) extends DefNode with Product with Serializable
A SQL comprehension
- trait DefNode extends Node
A Node which introduces Symbols.
- final case class Distinct(generator: TermSymbol, from: Node, on: Node) extends ComplexFilteredQuery with BinaryNode with Product with Serializable
A .distinct call of type (CollectionType(c, t), _) => CollectionType(c, t).
- final case class Drop(from: Node, count: Node) extends SimpleFilteredQuery with BinaryNode with Product with Serializable
A .drop call.
- case class ElementSymbol(idx: Int) extends TermSymbol with Product with Serializable
An element of a ProductNode (using a 1-based index)
- class ErasedCollectionTypeConstructor[C[_]] extends TypedCollectionTypeConstructor[C]
- class ErasedScalaBaseType[T, E] extends ScalaBaseType[T]
- case class FieldSymbol(name: String)(options: Seq[ColumnOption[_]], tpe: Type) extends TermSymbol with Product with Serializable
A named symbol which refers to an (aliased or unaliased) field.
- final case class Filter(generator: TermSymbol, from: Node, where: Node) extends ComplexFilteredQuery with BinaryNode with Product with Serializable
A .filter call of type (CollectionType(c, t), Boolean) => CollectionType(c, t).
- abstract class FilteredQuery extends Node
Common superclass for expressions of type (CollectionType(c, t), _) => CollectionType(c, t).
- final case class First(child: Node) extends UnaryNode with SimplyTypedNode with ClientSideOp with Product with Serializable
Get the first element of a collection.
Get the first element of a collection. For client-side operations only.
- final case class ForUpdate(generator: TermSymbol, from: Node) extends ComplexFilteredQuery with Product with Serializable
A .forUpdate call
- class FunctionSymbol extends TermSymbol
A Symbol that represents a library function or operator
- final case class GetOrElse(child: Node, default: () => Any) extends UnaryNode with SimplyTypedNode with Product with Serializable
- final case class GroupBy(fromGen: TermSymbol, from: Node, by: Node, identity: TypeSymbol = new AnonTypeSymbol) extends BinaryNode with DefNode with TypeGenerator with Product with Serializable
A .groupBy call.
- final case class IfThenElse(clauses: ConstArray[Node]) extends SimplyTypedNode with Product with Serializable
A conditional expression; The clauses should be:
(if then)+ else
.A conditional expression; The clauses should be:
(if then)+ else
. The result type is taken from the firstthen
(i.e. the second clause). - final case class Insert(tableSym: TermSymbol, table: Node, linear: Node, allFields: ConstArray[FieldSymbol]) extends BinaryNode with DefNode with Product with Serializable
Represents an Insert operation.
- final case class InsertColumn(children: ConstArray[Node], fs: FieldSymbol, buildType: Type) extends Node with SimplyTypedNode with Product with Serializable
A column in an Insert operation.
- final case class Join(leftGen: TermSymbol, rightGen: TermSymbol, left: Node, right: Node, jt: JoinType, on: Node) extends DefNode with Product with Serializable
A join expression.
A join expression. For joins without option extension, the type rule is (CollectionType(c, t), CollectionType(_, u)) => CollecionType(c, (t, u)). Option-extended left outer joins are typed as (CollectionType(c, t), CollectionType(_, u)) => CollecionType(c, (t, Option(u))), Option-extended right outer joins as (CollectionType(c, t), CollectionType(_, u)) => CollecionType(c, (Option(t), u)) and Option-extended full outer joins as (CollectionType(c, t), CollectionType(_, u)) => CollecionType(c, (Option(t), Option(u))).
- abstract class JoinType extends AnyRef
The type of a join operation.
- class LiteralNode extends NullaryNode with SimplyTypedNode
A literal value expression.
- final class MappedScalaType extends Type
- trait Node extends Dumpable
A node in the Slick AST.
A node in the Slick AST. Every Node has a number of child nodes and an optional type annotation.
- final class NodeOps extends AnyVal
Extra methods for Nodes.
- final case class NominalType(sym: TypeSymbol, structuralView: Type) extends Type with Product with Serializable
A type with a name, as used by tables.
A type with a name, as used by tables.
Compiler phases which change types may keep their own representation of the structural view but must update the AST at the end of the phase so that all NominalTypes with the same symbol have the same structural view.
- trait NullaryNode extends Node
- trait NumericTypedType extends AnyRef
Mark a TypedType as eligible for numeric operators.
- final case class OptionApply(child: Node) extends UnaryNode with SimplyTypedNode with Product with Serializable
Lift a value into an Option as Some (or None if the value is a
null
column). - sealed trait OptionDisc extends AnyRef
A phantom type for Option discriminator columns.
A phantom type for Option discriminator columns. Values are of type Int.
- final case class OptionFold(from: Node, ifEmpty: Node, map: Node, gen: TermSymbol) extends DefNode with Product with Serializable
The catamorphism of OptionType.
- trait OptionType extends Type
- trait OptionTypedType[T] extends TypedType[Option[T]] with OptionType
- final case class Ordering(direction: Direction = Ordering.Asc, nulls: NullOrdering = Ordering.NullsDefault) extends Product with Serializable
- final case class ParameterSwitch(cases: ConstArray[((Any) => Boolean, Node)], default: Node) extends SimplyTypedNode with ClientSideOp with Product with Serializable
A switch for special-cased parameters that needs to be interpreted in order to find the correct query string for the query arguments.
- trait PathElement extends Node
- final case class ProductNode(children: ConstArray[Node]) extends SimplyTypedNode with Product with Serializable
An expression that represents a conjunction of expressions.
- final case class ProductType(elements: ConstArray[Type]) extends Type with Product with Serializable
- final case class Pure(value: Node, identity: TypeSymbol = new AnonTypeSymbol) extends UnaryNode with SimplyTypedNode with TypeGenerator with Product with Serializable
An expression that represents a plain value lifted into a Query.
- final case class QueryParameter(extractor: (Any) => Any, buildType: Type, id: TermSymbol = new AnonSymbol) extends NullaryNode with SimplyTypedNode with Product with Serializable
A parameter from a QueryTemplate which gets turned into a bind variable.
- final case class RangeFrom(start: Long = 1L) extends NullaryNode with SimplyTypedNode with Product with Serializable
A Query of this special Node represents an infinite stream of consecutive numbers starting at the given number.
A Query of this special Node represents an infinite stream of consecutive numbers starting at the given number. This is used as an operand for zipWithIndex. It is not exposed directly in the query language because it cannot be represented in SQL outside of a 'zip' operation.
- final case class RebuildOption(discriminator: Node, data: Node) extends BinaryNode with SimplyTypedNode with Product with Serializable
Rebuild an Option type on the client side
- final case class Ref(sym: TermSymbol) extends PathElement with NullaryNode with Product with Serializable
A reference to a Symbol
- final case class ResultSetMapping(generator: TermSymbol, from: Node, map: Node) extends BinaryNode with DefNode with ClientSideOp with Product with Serializable
A client-side projection of type
.(CollectionType(c, t), u) => CollectionType(c, u)
A client-side projection of type
. Unlike other nodes which only operate on real collections, a ResultSetMapping may use an Identity functor as its collection type constructor(CollectionType(c, t), u) => CollectionType(c, u)
, thus giving it a type ofc
where(t, u) => u
andt
are primitive or Option types.u
- final case class RowNumber(by: ConstArray[(Node, Ordering)] = ConstArray.empty) extends SimplyTypedNode with Product with Serializable
The row_number window function
- class ScalaBaseType[T] extends ScalaType[T] with BaseTypedType[T]
- class ScalaNumericType[T] extends ScalaBaseType[T] with NumericTypedType
- class ScalaOptionType[T] extends ScalaType[Option[T]] with OptionTypedType[T]
- trait ScalaType[T] extends TypedType[T]
A Slick Type encoding of plain Scala types.
A Slick Type encoding of plain Scala types.
This is used by QueryInterpreter and MemoryProfile. Values stored in HeapBackend columns are also expected to use these types.
All profiles should support the following types which are used internally by the lifted embedding and the query compiler: Boolean, Char, Int, Long, Null, String.
- final case class Select(in: Node, field: TermSymbol) extends PathElement with UnaryNode with SimplyTypedNode with Product with Serializable
An expression that selects a field in another expression.
- final case class SequenceNode(name: String)(increment: Long) extends NullaryNode with SimplyTypedNode with Product with Serializable
A node that represents an SQL sequence.
- abstract class SimpleFilteredQuery extends FilteredQuery with SimplyTypedNode
A FilteredQuery without a Symbol.
- case class SimpleTableIdentitySymbol(constituents: AnyRef*) extends TableIdentitySymbol with Product with Serializable
Default implementation of TableIdentitySymbol
- trait SimplyTypedNode extends Node
A Node which can be typed without access to its scope, and whose children can be typed independently of each other.
- final case class SortBy(generator: TermSymbol, from: Node, by: ConstArray[(Node, Ordering)]) extends ComplexFilteredQuery with Product with Serializable
A .sortBy call of type (CollectionType(c, t), _) => CollectionType(c, t).
- final case class StructNode(elements: ConstArray[(TermSymbol, Node)]) extends SimplyTypedNode with DefNode with Product with Serializable
An expression that represents a structure, i.e.
An expression that represents a structure, i.e. a conjunction where the individual components have Symbols associated with them.
- final case class StructType(elements: ConstArray[(TermSymbol, Type)]) extends Type with Product with Serializable
- final case class Subquery(child: Node, condition: Condition) extends UnaryNode with SimplyTypedNode with Product with Serializable
Forces a subquery to be created in
mergeToComprehension
if it occurs between two other collection-valued operations that would otherwise be fused, and the subquery condition is true. - sealed trait Symbol extends AnyRef
A symbol which can be used in the AST.
A symbol which can be used in the AST. It can be either a TypeSymbol or a TermSymbol.
- class SymbolNamer extends AnyRef
Provides names for symbols
- final case class TableExpansion(generator: TermSymbol, table: Node, columns: Node) extends BinaryNode with DefNode with Product with Serializable
A table together with its expansion into columns.
- trait TableIdentitySymbol extends TypeSymbol
A TypeSymbol which uniquely identifies a table type
- final case class TableNode(schemaName: Option[String], tableName: String, identity: TableIdentitySymbol, baseIdentity: TableIdentitySymbol)(profileTable: Any) extends NullaryNode with SimplyTypedNode with TypeGenerator with Product with Serializable
A Node representing a database table.
- final case class Take(from: Node, count: Node) extends SimpleFilteredQuery with BinaryNode with Product with Serializable
A .take call.
- trait TermSymbol extends Symbol
A symbol representing a variable
- trait Type extends Dumpable
Super-trait for all types
- trait TypeGenerator extends AnyRef
A Node which introduces a NominalType.
- final case class TypeMapping(child: Node, mapper: Mapper, classTag: ClassTag[_]) extends UnaryNode with SimplyTypedNode with Product with Serializable
A client-side type mapping
- trait TypeSymbol extends Symbol
The symbol of a nominal type
- final class TypeUtil extends AnyVal
- abstract class TypedCollectionTypeConstructor[C[_]] extends CollectionTypeConstructor
- Annotations
- @implicitNotFound()
- trait TypedType[T] extends Type
A Type that carries a Scala type argument
- trait UnaryNode extends Node
- final case class Union(left: Node, right: Node, all: Boolean) extends BinaryNode with SimplyTypedNode with Product with Serializable
A union of type (CollectionType(c, t), CollectionType(_, t)) => CollectionType(c, t).
Value Members
- object ClientSideOp
- object ColumnOption
The basic column options that influence profile-independent parts of query compilation.
The basic column options that influence profile-independent parts of query compilation. Different profile levels define additional options.
- object Filter extends Serializable
- object FwdPath
A constructor/extractor for nested Selects starting at a Ref so that, for example,
a :: b :: c :: Nil
corresponds to patha.b.c
. - object JoinType
- object Library
The standard library for query operators.
- object LiteralNode
- object MappedScalaType
- object OptionType
- object Ordering extends Serializable
- object Path
A constructor/extractor for nested Selects starting at a Ref so that, for example,
c :: b :: a :: Nil
corresponds to patha.b.c
. - object QueryParameter extends Serializable
- object ScalaBaseType
- object Subquery extends Serializable
- object SymbolNamer
- object Type
- object TypeUtil
- object TypedCollectionTypeConstructor
- object TypedType
- case object UnassignedType extends AtomicType with Product with Serializable
The standard type for freshly constructed nodes without an explicit type.
- object Util
Utility methods for AST manipulation.
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...