The driver-independent superclass of all table row objects.
The driver-independent superclass of all table row objects.
Row type for this table. Make sure it matches the type of your *
projection.
Aliases for lifted embedding features.
Aliases for lifted embedding features. This trait can be mixed into aliasing objects which simplify the use of the lifted embedding.
Extension methods for all columns and all primitive values that can be lifted to columns
Extension methods for Options of single- and multi-column values
A Tag marking the base table instance itself
Extension methods for Rep[Boolean] and Rep[Option[Boolean]]
A typeclass for types that can be used as predicates in filter
calls.
A typeclass for types that can be used as predicates in filter
calls.
A generic case class shape that can be used to lift a case class of plain Scala types to a case class of lifted types.
A generic case class shape that can be used to lift a case class of plain Scala types to a case class of lifted types. This allows the type to be used as a record type (like tuples and HLists) in the Lifted Embedding.
Example:
case class C(a: Int, b: Option[String]) case class LiftedC(a: Column[Int], b: Column[Option[String]]) implicit object cShape extends CaseClassShape(LiftedC.tupled, C.tupled)
Extension methods for all columns
A Column
with an associated Ordering
.
ShapeLevel that only allows records of individual columns.
ShapeLevel that only allows records of individual columns. This level is used for parameters of compiled queries.
Typeclass for types that can be contained in a Compiled
container.
Typeclass for types that can be contained in a Compiled
container. This
includes all Executable
types as well as functions (of any arity) from
flat, fully packed parameter types to an Executable
result type.
A possibly parameterized query that will be cached for repeated efficient execution without having to recompile it every time.
A possibly parameterized query that will be cached for repeated efficient
execution without having to recompile it every time. The compiled state
is computed on demand the first time a Cached
value is executed. It is
always tied to a specific driver.
Cached
forms a limited monad which ensures that it can only contain
values that are Compilable
.
A scalar value that is known at the client side at the time a query is executed.
A scalar value that is known at the client side at the time a query is executed.
This is either a constant value (LiteralColumn
) or a scalar parameter.
Marker trait for foreign key and primary key constraints.
Typeclass for types that can be executed as queries.
Typeclass for types that can be executed as queries. This encompasses
collection-valued (Query[_, _, _[_] ]
), scalar and record types.
ShapeLevel that does not allow nested collections.
ShapeLevel that does not allow nested collections. This is the standard level for executable queries.
Represents a foreign key.
Represents a foreign key. Objects of this type are used internally by Slick.
At the user level you generally see ForeignKeyQuery
objects instead.
A query that selects data linked by a foreign key.
Utility methods for internal use in the lifted embedding
An index (or foreign key constraint with an implicit index).
An isomorphism between two types that can be used for mapped column types.
A column with a constant value which is inserted into an SQL statement as a literal.
Base class for ProductNodeShapes with a type mapping
Base class for ProductNodeShapes with a type mapping to a type that extends scala.Product
The base type for automatically mapped column types.
The base type for automatically mapped column types.
Extending this type (with a type parameter
which is already a
supported column type) lets you use your custom type as a column
type in the Lifted Embedding. You must provide a constructor that
takes a single value of the underlying type (same restriction as
for value classes).T
ShapeLevel that allows nested collections.
Extension methods for numeric columns
A typeclass that lifts a mixed type to the packed Option type.
An explicit primary key.
An explicit primary key. Simple primary keys can also be represented by O.PrimaryKey
column options instead.
A generic Product class shape that can be used to lift a class of plain Scala types to a class of lifted types.
A generic Product class shape that can be used to lift a class of plain Scala types to a class of lifted types. This allows the type to be used as a record type (like tuples and HLists) in the Lifted Embedding.
This can help with mapping tables >22 columns to classes, especially when using code generation. This can be used for Scala 2.11 case classes >22 fields.
Example:
def columnShape[T](implicit s: Shape[FlatShapeLevel, Column[T], T, Column[T]]) = s class C(val a: Int, val b: Option[String]) extends Product{ def canEqual(that: Any): Boolean = that.isInstanceOf[C] def productArity: Int = 2 def productElement(n: Int): Any = Seq(a, b)(n) } class LiftedC(val a: Column[Int], val b: Column[Option[String]]) extends Product{ def canEqual(that: Any): Boolean = that.isInstanceOf[LiftedC] def productArity: Int = 2 def productElement(n: Int): Any = Seq(a, b)(n) } implicit object cShape extends ProductClassShape( Seq(columnShape[Int], columnShape[Option[String]]), seq => new LiftedC(seq(0).asInstanceOf[Column[Int]], seq(1).asInstanceOf[Column[Option[String]]]), seq => new C(seq(0).asInstanceOf[Int], seq(1).asInstanceOf[Option[String]]) )
Base class for Shapes of record values which are represented by ProductNodes in the AST.
Base class for Shapes of record values which are represented by ProductNodes in the AST.
The supertype for the record values.
The mixed type of the Shape (a subtype of C).
The unpacked type of the Shape (a subtype of C).
The fully packed type of the Shape (a subtype of C).
A limited version of ShapedValue which can be constructed for every type that has a valid shape.
A limited version of ShapedValue which can be constructed for every type that has a valid shape. We use it to enforce that a table's * projection has a valid shape. A ProvenShape has itself a Shape so it can be used in place of the value that it wraps for purposes of packing and unpacking.
An instance of Query represents a query or view, i.e.
An instance of Query represents a query or view, i.e. a computation of a collection type (Rep[Seq[T]]). It is parameterized with both, the mixed type (the type of values you see e.g. when you call map()) and the unpacked type (the type of values that you get back when you run the query).
Additional extension methods for queries containing a single column are defined in slick.lifted.SingleColumnQueryExtensionMethods.
A Tag for table instances that represent a Node
Common base trait for all lifted values, including columns.
Common base trait for all lifted values, including columns.
All column operations are added with extension methods that depend on the type inside the Rep
.
These are defined in:
Option
typesOption
typesBoolean
/ Option[Boolean]
String
/ Option[String]
sortBy
callsA Rep[T : TypedType]
is always Typed
, so that the TypedType
can be retrieved directly
from the Rep
value.
Represents Rep[Option[T]]
in all cases where T
is not a column base type.
Represents Rep[Option[T]]
in all cases where T
is not a column base type. This special
representation is necessary so that a non-Option Rep
value can be retrieved for encoding
Option-based operations. This base value is of type T
if T <: Rep[_]
, otherwise of
type Rep[T]
.
A compiled value that can be executed to obtain its result.
A type class that encodes the unpacking Mixed => Unpacked
of a
Query[Mixed]
to its result element type Unpacked
and the packing to a
fully packed type Packed
, i.e.
A type class that encodes the unpacking Mixed => Unpacked
of a
Query[Mixed]
to its result element type Unpacked
and the packing to a
fully packed type Packed
, i.e. a type where everything which is not a
transparent container is wrapped in a Column[_]
.
- Mixed: (Column[Int], Column[(Int, String)], (Int, Option[Double])) - Unpacked: (Int, (Int, String), (Int, Option[Double])) - Packed: (Column[Int], Column[(Int, String)], (Column[Int], Column[Option[Double]])) - Linearized: (Int, Int, String, Int, Option[Double])
The level of a Shape, i.e.
The level of a Shape, i.e. what kind of types it allows. Subtypes of this trait are used as a phantom type for Shape resolution. There are no instances of any ShapeLevel.
A value together with its Shape
A SimpleBinaryOperator gets translated to a binary operator call in SQL.
A SimpleExpression allows arbitrary SQL code to be generated.
A SimpleFunction gets translated to a plain function call or JDBC/ODBC scalar function {fn ...} call in SQL.
A SimpleLiteral is inserted verbatim into a SQL query string.
A SimpleLiteral is inserted verbatim into a SQL query string. For the purpose of handling it in the query compiler it is assumed to be an expression of the specified type.
Extension methods for Queries of a single column
A compiled value that can be executed to obtain its result as a stream of data.
Typeclass for types that can be executed as streaming queries, i.e.
Typeclass for types that can be executed as streaming queries, i.e. only
collection-valued (Query[_, _, _[_] ]
) types. This is used
as a phantom type for computing the required types. The actual value is
always null
.
Extension methods for Rep[String] and Rep[Option[String]]
Represents a database table.
Represents a database table. Profiles add extension methods to TableQuery for operations that can be performed on tables but not on arbitrary queries, e.g. getting the table DDL.
A Tag marks a specific row represented by an AbstractTable instance.
Shape for Scala tuples of all arities
Case
provides a DSL for conditional statements in the query language.
Case
provides a DSL for conditional statements in the query language.
An arbitrary number of If
...Then
expressions can be chained, optionally
followed by Else
, e.g.:
Case If u.id < 3 Then "low" If u.id < 6 Then "medium" Else "high"
All result expressions have to be of compatible type (modulo nullability).
If at least one of them is an Option
type or the Else
branch is
missing, the result is also an Option
.
Contains stand-alone database functions for use in queries.
Contains stand-alone database functions for use in queries. Functions which operate on columns are generally added as extension methods to the appropriate column types instead.
The companion object for Query contains factory methods for creating queries.
Shape for Rep values (always fully packed)
A prototype StreamingExecutable
instance for Rep
types.
Lifted embedding: Stable query api based on implicits and overloading lifting Scala code into Slick ASTs