Class/Object

slick.lifted

TableQuery

Related Docs: object TableQuery | package lifted

Permalink

class TableQuery[E <: AbstractTable[_]] extends Query[E, lifted.TableQuery.E.TableElementType, Seq]

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.

Source
Query.scala
Linear Supertypes
Query[E, E.TableElementType, Seq], QueryBase[Seq[E.TableElementType]], Rep[Seq[E.TableElementType]], AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TableQuery
  2. Query
  3. QueryBase
  4. Rep
  5. AnyRef
  6. Any
Implicitly
  1. by CollectionsHaveToParArray
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TableQuery(cons: (Tag) ⇒ E)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from TableQuery[E] to any2stringadd[TableQuery[E]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ++[O >: E, R, D[_]](other: Query[O, E.TableElementType, D]): Query[O, E.TableElementType, Seq]

    Permalink

    Return a new query containing the elements from both operands.

    Return a new query containing the elements from both operands. Duplicate elements are preserved.

    Definition Classes
    Query
  5. def ->[B](y: B): (TableQuery[E], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from TableQuery[E] to ArrowAssoc[TableQuery[E]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def baseTableRow: E

    Permalink

    Get the "raw" table row that represents the table itself, as opposed to a Path for a variable of the table's type.

    Get the "raw" table row that represents the table itself, as opposed to a Path for a variable of the table's type. This method should generally not be called from user code.

  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def distinct: Query[E, E.TableElementType, Seq]

    Permalink

    Remove duplicate elements.

    Remove duplicate elements. When used on an ordered Query, there is no guarantee in which order duplicates are removed. This method is equivalent to distinctOn(identity).

    Definition Classes
    Query
  11. def distinctOn[F, T](f: (E) ⇒ F)(implicit shape: Shape[_ <: FlatShapeLevel, F, T, _]): Query[E, E.TableElementType, Seq]

    Permalink

    Remove duplicate elements which are the same in the given projection.

    Remove duplicate elements which are the same in the given projection. When used on an ordered Query, there is no guarantee in which order duplicates are removed.

    Definition Classes
    Query
  12. def drop(num: Int): Query[E, E.TableElementType, Seq]

    Permalink

    Select all elements except the first num ones.

    Select all elements except the first num ones.

    Definition Classes
    Query
  13. def drop(num: Long): Query[E, E.TableElementType, Seq]

    Permalink

    Select all elements except the first num ones.

    Select all elements except the first num ones.

    Definition Classes
    Query
  14. def drop(num: ConstColumn[Long]): Query[E, E.TableElementType, Seq]

    Permalink

    Select all elements except the first num ones.

    Select all elements except the first num ones.

    Definition Classes
    Query
  15. def encodeRef(path: Node): Query[E, E.TableElementType, Seq]

    Permalink

    Encode a reference into this Rep.

    Encode a reference into this Rep.

    Definition Classes
    QueryRep
  16. def ensuring(cond: (TableQuery[E]) ⇒ Boolean, msg: ⇒ Any): TableQuery[E]

    Permalink
    Implicit information
    This member is added by an implicit conversion from TableQuery[E] to Ensuring[TableQuery[E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: (TableQuery[E]) ⇒ Boolean): TableQuery[E]

    Permalink
    Implicit information
    This member is added by an implicit conversion from TableQuery[E] to Ensuring[TableQuery[E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean, msg: ⇒ Any): TableQuery[E]

    Permalink
    Implicit information
    This member is added by an implicit conversion from TableQuery[E] to Ensuring[TableQuery[E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean): TableQuery[E]

    Permalink
    Implicit information
    This member is added by an implicit conversion from TableQuery[E] to Ensuring[TableQuery[E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  22. def exists: Rep[Boolean]

    Permalink

    Test whether this query is non-empty.

    Test whether this query is non-empty.

    Definition Classes
    Query
  23. def filter[T <: Rep[_]](f: (E) ⇒ T)(implicit wt: CanBeQueryCondition[T]): Query[E, E.TableElementType, Seq]

    Permalink

    Select all elements of this query which satisfy a predicate.

    Select all elements of this query which satisfy a predicate. Unlike withFilter, this method only allows Rep-valued predicates, so it guards against the accidental use plain Booleans.

    Definition Classes
    Query
  24. def filterIf(p: Boolean)(f: (E) ⇒ Rep[Boolean]): Query[E, E.TableElementType, Seq]

    Permalink

    Applies the given filter function, if the boolean parameter p evaluates to true.

    Applies the given filter function, if the boolean parameter p evaluates to true. If not, the filter will not be part of the query.

    Definition Classes
    Query
  25. def filterNot[T <: Rep[_]](f: (E) ⇒ T)(implicit wt: CanBeQueryCondition[T]): Query[E, E.TableElementType, Seq]

    Permalink
    Definition Classes
    Query
  26. def filterOpt[V, T <: Rep[_]](optValue: Option[V])(f: (E, V) ⇒ T)(implicit arg0: CanBeQueryCondition[T]): Query[E, E.TableElementType, Seq]

    Permalink

    Applies the given filter, if the Option value is defined.

    Applies the given filter, if the Option value is defined. If the value is None, the filter will not be part of the query.

    Definition Classes
    Query
  27. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. def flatMap[F, T, D[_]](f: (E) ⇒ Query[F, T, D]): Query[F, T, Seq]

    Permalink

    Build a new query by applying a function to all elements of this query and using the elements of the resulting queries.

    Build a new query by applying a function to all elements of this query and using the elements of the resulting queries. This corresponds to an implicit inner join in SQL.

    Definition Classes
    Query
  29. def forUpdate: Query[E, E.TableElementType, Seq]

    Permalink

    Specify part of a select statement for update and marked for row level locking

    Specify part of a select statement for update and marked for row level locking

    Definition Classes
    Query
  30. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from TableQuery[E] to StringFormat[TableQuery[E]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  31. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  32. def groupBy[K, T, G, P](f: (E) ⇒ K)(implicit kshape: Shape[_ <: FlatShapeLevel, K, T, G], vshape: Shape[_ <: FlatShapeLevel, E, _, P]): Query[(G, Query[P, E.TableElementType, Seq]), (T, Query[P, E.TableElementType, Seq]), Seq]

    Permalink

    Partition this query into a query of pairs of a key and a nested query containing the elements for the key, according to some discriminator function.

    Partition this query into a query of pairs of a key and a nested query containing the elements for the key, according to some discriminator function.

    Definition Classes
    Query
  33. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  34. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  35. def join[E2, U2, D[_]](q2: Query[E2, U2, D]): BaseJoinQuery[E, E2, E.TableElementType, U2, Seq, E, E2]

    Permalink

    Join two queries with a cross join or inner join.

    Join two queries with a cross join or inner join. An optional join predicate can be specified later by calling on.

    Definition Classes
    Query
  36. def joinFull[E1 >: E, E2, U2, D[_], O1, U1, O2](q2: Query[E2, _, D])(implicit ol1: OptionLift[E1, O1], sh1: Shape[FlatShapeLevel, O1, U1, _], ol2: OptionLift[E2, O2], sh2: Shape[FlatShapeLevel, O2, U2, _]): BaseJoinQuery[O1, O2, U1, U2, Seq, E, E2]

    Permalink

    Join two queries with a full outer join.

    Join two queries with a full outer join. An optional join predicate can be specified later by calling on. Both sides of the join are lifted to an Option. If at least one element on either side matches the other side, all matching elements are returned as Some, otherwise a single None row is returned.

    Definition Classes
    Query
  37. def joinLeft[E2, U2, D[_], O2](q2: Query[E2, _, D])(implicit ol: OptionLift[E2, O2], sh: Shape[FlatShapeLevel, O2, U2, _]): BaseJoinQuery[E, O2, E.TableElementType, U2, Seq, E, E2]

    Permalink

    Join two queries with a left outer join.

    Join two queries with a left outer join. An optional join predicate can be specified later by calling on. The right side of the join is lifted to an Option. If at least one element on the right matches, all matching elements are returned as Some, otherwise a single None row is returned.

    Definition Classes
    Query
  38. def joinRight[E1 >: E, E2, U2, D[_], O1, U1](q2: Query[E2, U2, D])(implicit ol: OptionLift[E1, O1], sh: Shape[FlatShapeLevel, O1, U1, _]): BaseJoinQuery[O1, E2, U1, U2, Seq, E, E2]

    Permalink

    Join two queries with a right outer join.

    Join two queries with a right outer join. An optional join predicate can be specified later by calling on. The left side of the join is lifted to an Option. If at least one element on the left matches, all matching elements are returned as Some, otherwise a single None row is returned.

    Definition Classes
    Query
  39. def length: Rep[Int]

    Permalink

    The total number of elements (i.e.

    The total number of elements (i.e. rows).

    Definition Classes
    Query
  40. def map[F, G, T](f: (E) ⇒ F)(implicit shape: Shape[_ <: FlatShapeLevel, F, T, G]): Query[G, T, Seq]

    Permalink

    Build a new query by applying a function to all elements of this query.

    Build a new query by applying a function to all elements of this query.

    Definition Classes
    Query
  41. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  42. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  43. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  44. def pack[R](implicit packing: Shape[_ <: FlatShapeLevel, E, _, R]): Query[R, E.TableElementType, Seq]

    Permalink
    Definition Classes
    Query
  45. final lazy val packed: Node

    Permalink
    Definition Classes
    Query
  46. lazy val shaped: ShapedValue[E, E.TableElementType]

    Permalink
    Definition Classes
    TableQueryQuery
  47. def size: Rep[Int]

    Permalink

    The total number of elements (i.e.

    The total number of elements (i.e. rows).

    Definition Classes
    Query
  48. def sortBy[T](f: (E) ⇒ T)(implicit ev: (T) ⇒ Ordered): Query[E, E.TableElementType, Seq]

    Permalink

    Sort this query according to a function which extracts the ordering criteria from the query's elements.

    Sort this query according to a function which extracts the ordering criteria from the query's elements.

    Definition Classes
    Query
  49. def sorted(implicit ev: (E) ⇒ Ordered): Query[E, E.TableElementType, Seq]

    Permalink

    Sort this query according to a the ordering of its elements.

    Sort this query according to a the ordering of its elements.

    Definition Classes
    Query
  50. def subquery: Query[E, E.TableElementType, Seq]

    Permalink

    Force a subquery to be created when using this Query as part of a larger Query.

    Force a subquery to be created when using this Query as part of a larger Query. This method should never be necessary for correctness. If a query works with an explicit .subquery call but fails without, this should be considered a bug in Slick. The method is exposed in the API to enable workarounds to be written in such cases.

    Definition Classes
    Query
  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  52. def take(num: Int): Query[E, E.TableElementType, Seq]

    Permalink

    Select the first num elements.

    Select the first num elements.

    Definition Classes
    Query
  53. def take(num: Long): Query[E, E.TableElementType, Seq]

    Permalink

    Select the first num elements.

    Select the first num elements.

    Definition Classes
    Query
  54. def take(num: ConstColumn[Long]): Query[E, E.TableElementType, Seq]

    Permalink

    Select the first num elements.

    Select the first num elements.

    Definition Classes
    Query
  55. def to[D[_]](implicit ctc: TypedCollectionTypeConstructor[D]): Query[E, E.TableElementType, D]

    Permalink

    Change the collection type to build when executing the query.

    Change the collection type to build when executing the query.

    Definition Classes
    Query
  56. lazy val toNode: Node

    Permalink

    Get the Node for this Rep.

    Get the Node for this Rep.

    Definition Classes
    TableQueryRep
  57. def toParArray: ParArray[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from TableQuery[E] to CollectionsHaveToParArray[TableQuery[E], T] performed by method CollectionsHaveToParArray in scala.collection.parallel. This conversion will take place only if an implicit value of type (TableQuery[E]) ⇒ GenTraversableOnce[T] is in scope.
    Definition Classes
    CollectionsHaveToParArray
  58. def toString(): String

    Permalink
    Definition Classes
    Rep → AnyRef → Any
  59. def union[O >: E, R, D[_]](other: Query[O, E.TableElementType, D]): Query[O, E.TableElementType, Seq]

    Permalink

    Return a new query containing the elements from both operands.

    Return a new query containing the elements from both operands. Duplicate elements are eliminated from the result.

    Definition Classes
    Query
  60. def unionAll[O >: E, R, D[_]](other: Query[O, E.TableElementType, D]): Query[O, E.TableElementType, Seq]

    Permalink

    Return a new query containing the elements from both operands.

    Return a new query containing the elements from both operands. Duplicate elements are preserved.

    Definition Classes
    Query
  61. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. def withFilter[T](f: (E) ⇒ T)(implicit arg0: CanBeQueryCondition[T]): Query[E, E.TableElementType, Seq]

    Permalink

    Select all elements of this query which satisfy a predicate.

    Select all elements of this query which satisfy a predicate. This method is used when desugaring for-comprehensions over queries. There is no reason to call it directly because it is the same as filter.

    Definition Classes
    Query
  65. def zip[E2, U2, D[_]](q2: Query[E2, U2, D]): Query[(E, E2), (E.TableElementType, U2), Seq]

    Permalink

    Return a query formed from this query and another query by combining corresponding elements in pairs.

    Return a query formed from this query and another query by combining corresponding elements in pairs.

    Definition Classes
    Query
  66. def zipWith[E2, U2, F, G, T, D[_]](q2: Query[E2, U2, D], f: (E, E2) ⇒ F)(implicit shape: Shape[_ <: FlatShapeLevel, F, T, G]): Query[G, T, Seq]

    Permalink

    Return a query formed from this query and another query by combining corresponding elements with the specified function.

    Return a query formed from this query and another query by combining corresponding elements with the specified function.

    Definition Classes
    Query
  67. def zipWithIndex: BaseJoinQuery[E, Rep[Long], E.TableElementType, Long, Seq, E, Rep[Long]]

    Permalink

    Zip this query with its indices (starting at 0).

    Zip this query with its indices (starting at 0).

    Definition Classes
    Query
  68. def [B](y: B): (TableQuery[E], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from TableQuery[E] to ArrowAssoc[TableQuery[E]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def countDistinct: Rep[Int]

    Permalink

    The number of distinct elements of the query.

    The number of distinct elements of the query.

    Definition Classes
    Query
    Annotations
    @deprecated
    Deprecated

    (Since version 3.2) Use length on distinct or distinctOn instead of countDistinct

Inherited from Query[E, E.TableElementType, Seq]

Inherited from QueryBase[Seq[E.TableElementType]]

Inherited from Rep[Seq[E.TableElementType]]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion CollectionsHaveToParArray from TableQuery[E] to CollectionsHaveToParArray[TableQuery[E], T]

Inherited by implicit conversion any2stringadd from TableQuery[E] to any2stringadd[TableQuery[E]]

Inherited by implicit conversion StringFormat from TableQuery[E] to StringFormat[TableQuery[E]]

Inherited by implicit conversion Ensuring from TableQuery[E] to Ensuring[TableQuery[E]]

Inherited by implicit conversion ArrowAssoc from TableQuery[E] to ArrowAssoc[TableQuery[E]]

Ungrouped