Package

sqlest

ast

Permalink

package ast

Visibility
  1. Public
  2. All

Type Members

  1. case class AliasColumn[A](column: Column[_], columnAlias: String)(implicit columnType: ColumnType[A]) extends AliasedColumn[A] with Product with Serializable

    Permalink

    Alias for a column expression, e.g.

    Alias for a column expression, e.g. expression as alias

  2. sealed trait AliasedColumn[A] extends Column[A] with CellExtractor[ResultSet, A]

    Permalink

    A column that has an alias associated with it.

    A column that has an alias associated with it.

    The columns selected by a relation must all have aliases. This is how we address them in the JDBC ResultSet:

    SELECT a as a_alias, b as b_alias, c as c_alias FROM ...

  3. trait AliasedColumns[A] extends AnyRef

    Permalink

    Type class witnessing that all the elements in A are instances of AliasedColumn[_]

  4. sealed trait BaseColumnType[A] extends ColumnType[A]

    Permalink

    Trait representing a column type read directly from the database.

  5. trait BaseTable extends AnyRef

    Permalink

    A BaseTable allows columns to be defined on it.

    A BaseTable allows columns to be defined on it. It is a base type for Tables and TableFunctions

  6. trait BooleanMappedColumnTypes extends AnyRef

    Permalink
  7. sealed trait CaseColumn[A] extends Column[A]

    Permalink

    Case statement *

  8. case class CaseColumnColumn[A, B](column: Column[B], mappings: List[(Column[_], Column[A])])(implicit columnType: ColumnType[A]) extends CaseColumn[A] with Product with Serializable

    Permalink

    A case statement that compares a column to multiple values.

    A case statement that compares a column to multiple values. e.g.

    case position when 1 then 'Gold' when 2 then 'Silver' when 3 then 'Bronze' end

  9. case class CaseColumnElseColumn[A, B](column: Column[B], mappings: List[(Column[_], Column[A])], else: Column[A])(implicit columnType: ColumnType[A]) extends CaseColumn[A] with Product with Serializable

    Permalink

    A case statement that compares a column to multiple values e.g.

    A case statement that compares a column to multiple values e.g.

    case position when 1 then 'Gold' when 2 then 'Silver' when 3 then 'Bronze' else 'Other' end

  10. case class CaseWhenColumn[A](whens: List[When[A]])(implicit columnType: ColumnType[A]) extends CaseColumn[A] with Product with Serializable

    Permalink

    A case statement with no else clause

    A case statement with no else clause

    case when position = 1 then 'Gold' when position = 2 then 'Silver' when position = 3 then 'Bronze' end

  11. case class CaseWhenElseColumn[A](whens: List[When[A]], else: Column[A])(implicit columnType: ColumnType[A]) extends CaseColumn[A] with Product with Serializable

    Permalink

    A case statement with an else clause

    A case statement with an else clause

    case when position = 1 then 'Gold' when position = 2 then 'Silver' when position = 3 then 'Bronze' else 'Other' end

  12. sealed trait Column[A] extends AnyRef

    Permalink

    A column, column literal, or column expression.

    A column, column literal, or column expression.

    This is a more general concept than it may first seem. For example, in the SQL:

    SELECT a, b, c FROM t WHERE a == 1

    all of the following would be represented as instances of Column: a, b, c, 1, and a == 1.

  13. case class ColumnGroup(column: Column[_]) extends Group with Product with Serializable

    Permalink
  14. sealed trait ColumnType[A] extends AnyRef

    Permalink

    Object representing a mapping between a Scala data type and an underlying SQL data type.

    Object representing a mapping between a Scala data type and an underlying SQL data type. Column types are broadly divided into three categories:

    • BaseColumnType represent Scala data types that can be directly mapped to SQL types;
    • OptionColumnTypes represent Scala Option types that are mapped to nullable SQL types;
    • MappedColumnTypes represent arbitrary mappings between Scala types and SQL types.
  15. trait ColumnTypeEquivalence[A, B] extends AnyRef

    Permalink

    Typeclass representing the equivalence of two column types.

    Typeclass representing the equivalence of two column types. For example: 1 === 2 is a valid sqlest expression but 1 === "2" is not.

    The main requirement for this class comes from OptionColumnTypes. sqlest is relaxed about allowing direct comparisons between optional and non-optional columns. For example, 1 === Some(2) is considered valid.

    The second requirement is that different numeric column types should be comparable

  16. trait Command extends Operation

    Permalink
  17. case class ConstantColumn[A](value: A)(implicit columnType: ColumnType[A]) extends Column[A] with Product with Serializable

    Permalink

    Constant column values, e.g.

    Constant column values, e.g. 1, 'foo', and so on. These are embedded directly in sql statements so beware of sql injection

  18. case class CrossJoin[R1 <: Relation, R2 <: Relation](left: R1, right: R2) extends Join[R1, R2] with Product with Serializable

    Permalink

    An outer join between two tables.

  19. case class Delete(from: Table, where: Option[Column[Boolean]]) extends Command with ColumnSyntax with Product with Serializable

    Permalink
  20. case class DoubleInfixFunctionColumn[A](infix1: String, infix2: String, parameter1: Column[_], parameter2: Column[_], parameter3: Column[_])(implicit columnType: ColumnType[A]) extends Column[A] with Product with Serializable

    Permalink

    Binary prefix, infix operators, e.g.

    Binary prefix, infix operators, e.g. a between 1 and 2

  21. trait EnumerationMappedColumnTypes extends AnyRef

    Permalink
  22. case class ExistsColumn(select: Select[_, _ <: Relation]) extends Column[Boolean] with Product with Serializable

    Permalink

    A column which is false if the select statement within it returns no rows

  23. case class FunctionGroup(name: String, groups: List[Group]) extends Group with Product with Serializable

    Permalink
  24. sealed trait Group extends AnyRef

    Permalink
  25. case class InfixFunctionColumn[A](name: String, parameter1: Column[_], parameter2: Column[_])(implicit columnType: ColumnType[A]) extends Column[A] with Product with Serializable

    Permalink

    Binary functions and operators, e.g.

    Binary functions and operators, e.g. 1 + 2, sum(1, 2).

  26. case class InnerJoin[R1 <: Relation, R2 <: Relation](left: R1, right: R2, condition: Column[Boolean]) extends Join[R1, R2] with Product with Serializable

    Permalink

    An inner join between two tables.

  27. sealed trait Insert extends Command

    Permalink
  28. case class InsertFromSelect[A](into: Table, columns: Seq[TableColumn[_]], select: Select[A, _ <: Relation])(implicit evidence$1: AliasedColumns[A]) extends Insert with Product with Serializable

    Permalink
  29. case class InsertValues(into: Table, setterLists: Seq[Seq[Setter[_, _]]]) extends Insert with Product with Serializable

    Permalink
  30. sealed trait Join[R1 <: Relation, R2 <: Relation] extends Relation

    Permalink

    A join over two relations.

  31. case class KeywordFunctionColumn[A](name: String)(implicit columnType: ColumnType[A]) extends Column[A] with Product with Serializable

    Permalink

    A KeywordFunctionColumn represents a

  32. case class Lateral[A, R <: Relation](select: Select[A, R]) extends Relation with Product with Serializable

    Permalink

    Allows use on Lateral in join conditions

  33. case class LeftExceptionJoin[R1 <: Relation, R2 <: Relation](left: R1, right: R2, condition: Column[Boolean]) extends Join[R1, R2] with Product with Serializable

    Permalink

    A left exception join (DB2-only) between two tables.

  34. case class LeftJoin[R1 <: Relation, R2 <: Relation](left: R1, right: R2, condition: Column[Boolean]) extends Join[R1, R2] with Product with Serializable

    Permalink

    A left join between two tables.

  35. case class LiteralColumn[A](value: A)(implicit columnType: ColumnType[A]) extends Column[A] with Product with Serializable

    Permalink

    Literal column values, e.g.

    Literal column values, e.g. 1, 'foo', and so on.

  36. trait LocalDateMappedColumnTypes extends AnyRef

    Permalink
  37. trait LowPriorityImplicits extends AnyRef

    Permalink
  38. abstract class MappedColumnType[A, B] extends ColumnType[A]

    Permalink

    Object representing a custom column type A with an underlying database type B.

    Object representing a custom column type A with an underlying database type B.

    For every MappedColumnType there is an underlying BaseColumnType.

  39. trait MappedColumnTypes extends StringMappedColumnTypes with BooleanMappedColumnTypes with EnumerationMappedColumnTypes with NumericMappedColumnTypes with LocalDateMappedColumnTypes with OptionColumnTypes

    Permalink

    Standard set of MappedColumnTypes for various column types:

  40. case class MatchedOp(op: Either[Update, DeleteSyntax]) extends MergeOperation with Product with Serializable

    Permalink
  41. case class MaterializeColumnTypeMacro(c: Context) extends Product with Serializable

    Permalink
  42. case class Merge[R <: Relation](into: (Table, String), using: (Select[_, R], String), condition: Column[Boolean], whenMatched: Option[Either[Update, DeleteSyntax]] = None, whenMatchedAnd: List[(Either[Update, DeleteSyntax], Column[Boolean])] = List(), whenNotMatched: Option[Insert] = None, whenNotMatchedAnd: List[(Insert, Column[Boolean])] = List()) extends Command with ColumnSyntax with Product with Serializable

    Permalink
  43. case class MergeMatch[R <: Relation](merge: Merge[R], op: MergeOperation) extends Product with Serializable

    Permalink
  44. trait MergeOperation extends AnyRef

    Permalink
  45. sealed trait NonNumericColumnType[A] extends BaseColumnType[A]

    Permalink
  46. case class NotExistsColumn(select: Select[_, _ <: Relation]) extends Column[Boolean] with Product with Serializable

    Permalink

    A column which is true if the select statement within it returns no rows

  47. case class NotMatchedOp(op: Insert) extends MergeOperation with Product with Serializable

    Permalink
  48. sealed trait NumericColumnType[A] extends BaseColumnType[A]

    Permalink
  49. trait NumericMappedColumnTypes extends AnyRef

    Permalink
  50. sealed trait Operation extends AnyRef

    Permalink
  51. case class OptionColumnType[A, B](nullValue: B, isNull: (B) ⇒ Boolean)(implicit innerColumnType: Aux[A, B]) extends ColumnType[Option[A]] with Product with Serializable

    Permalink

    Class representing an nullable SQL column type that is mapped to an Option in Scala.

    Class representing an nullable SQL column type that is mapped to an Option in Scala.

    For every OptionColumnType there is an underlying BaseColumnType.

  52. trait OptionColumnTypes extends AnyRef

    Permalink
  53. case class Order(column: Column[_], ascending: Boolean) extends Product with Serializable

    Permalink
  54. trait OrderedColumnType extends AnyRef

    Permalink
  55. case class OuterJoin[R1 <: Relation, R2 <: Relation](left: R1, right: R2, condition: Column[Boolean]) extends Join[R1, R2] with Product with Serializable

    Permalink

    An outer join between two tables.

  56. case class PostfixFunctionColumn[A](name: String, parameter: Column[_])(implicit columnType: ColumnType[A]) extends Column[A] with Product with Serializable

    Permalink

    Unary postfix functions and operators, e.g.

    Unary postfix functions and operators, e.g. a is null.

  57. case class PrefixFunctionColumn[A](name: String, parameter: Column[_])(implicit columnType: ColumnType[A]) extends Column[A] with Product with Serializable

    Permalink

    Unary prefix functions and operators, e.g.

    Unary prefix functions and operators, e.g. not a.

  58. trait Query extends Operation

    Permalink
  59. case class ReferenceColumn[A](columnAlias: String)(implicit columnType: ColumnType[A]) extends AliasedColumn[A] with Product with Serializable

    Permalink

    Used for refering to another column by alias

  60. sealed trait Relation extends AnyRef

    Permalink

    A source of columns from the database.

    A source of columns from the database. Tables, joins, and select statements are all types of relation.

  61. case class RightExceptionJoin[R1 <: Relation, R2 <: Relation](left: R1, right: R2, condition: Column[Boolean]) extends Join[R1, R2] with Product with Serializable

    Permalink

    A right exception join (DB2-only) between two tables.

  62. case class RightJoin[R1 <: Relation, R2 <: Relation](left: R1, right: R2, condition: Column[Boolean]) extends Join[R1, R2] with Product with Serializable

    Permalink

    A right join between two tables.

  63. case class ScalarFunctionColumn[A](name: String, parameters: Seq[Column[_]])(implicit columnType: ColumnType[A]) extends Column[A] with Product with Serializable

    Permalink

    A ScalarFunctionColumn should not be created by the user directly.

    A ScalarFunctionColumn should not be created by the user directly. Instead it will be returned as a result of applying a ScalarFunctionN (where N is a number) to a set of columns. See ScalarFunctions for the implementations of ScalarFunctionN

  64. trait ScalarFunctions extends AnyRef

    Permalink
  65. case class Select[A, R <: Relation](cols: A, from: R, where: Option[Column[Boolean]] = None, startWith: Option[Column[Boolean]] = None, connectBy: Option[Column[Boolean]] = None, groupBy: List[Group] = Nil, having: Option[Column[Boolean]] = None, orderBy: List[Order] = Nil, limit: Option[Long] = None, offset: Option[Long] = None, optimize: Option[Long] = None, union: List[Union[_]] = Nil, subselectAlias: Option[String] = None)(implicit aliasedColumns: AliasedColumns[A]) extends Relation with Query with ColumnSyntax with Product with Serializable

    Permalink

    A select statement or subselect.

  66. case class SelectColumn[A](select: Select[AliasedColumn[A], _ <: Relation])(implicit columnType: ColumnType[A]) extends Column[A] with Product with Serializable

    Permalink

    A column containing a select statement which selects only a single column

  67. class Setter[A, B] extends AnyRef

    Permalink
  68. trait StringMappedColumnTypes extends AnyRef

    Permalink
  69. abstract class Table extends Relation with BaseTable

    Permalink

    A database table.

  70. case class TableColumn[A](tableAlias: String, columnName: String)(implicit columnType: ColumnType[A]) extends AliasedColumn[A] with Product with Serializable

    Permalink

    Columns from tables.

  71. case class TableFunctionApplication[+T](tableName: String, aliasedAs: Option[String], parameterColumns: Seq[Column[_]], tableFunction: T) extends Relation with Product with Serializable

    Permalink

    This TableFunction case class should not be created by the user directly.

    This TableFunction case class should not be created by the user directly. Instead it will be returned as a result of applying a TableFunctionN (where N is a number) to a set of columns. See TableFunctions for the implementations of TableFunctionN

  72. case class TableFunctionFromSelect[A, R <: Relation](select: Select[A, R], aliasedAs: String) extends Relation with Product with Serializable

    Permalink

    A temporary table for the given select statement.

  73. trait TableFunctions extends AnyRef

    Permalink
  74. case class TupleGroup(groups: List[Group]) extends Group with Product with Serializable

    Permalink
  75. trait TupleGroups extends AnyRef

    Permalink
  76. case class Union[A](select: Select[A, _ <: Relation], unionAll: Boolean) extends Product with Serializable

    Permalink
  77. case class Update(table: Table, set: Seq[Setter[_, _]], where: Option[Column[Boolean]] = None) extends Command with ColumnSyntax with Product with Serializable

    Permalink

    An update statement.

  78. case class When[A](condition: Column[Boolean], result: Column[A]) extends Product with Serializable

    Permalink

    A when clause in a CaseColumn *

  79. case class WindowFunctionColumn(partitionByColumns: Seq[Column[_]], orderBy: Seq[Order]) extends Column[Int] with Product with Serializable

    Permalink

    Defines a window for use within an OLAP function

Value Members

  1. object AliasTableImpl

    Permalink
  2. object AliasedColumns

    Permalink
  3. object BigDecimalColumnType extends NumericColumnType[BigDecimal] with Product with Serializable

    Permalink
  4. object BooleanColumnType extends NonNumericColumnType[Boolean] with Product with Serializable

    Permalink
  5. object ByteArrayColumnType extends NonNumericColumnType[Array[Byte]] with Product with Serializable

    Permalink
  6. object ColumnType

    Permalink
  7. object ColumnTypeEquivalence extends LowPriorityImplicits

    Permalink
  8. object DateTimeColumnType extends NonNumericColumnType[DateTime] with Product with Serializable

    Permalink
  9. object DoubleColumnType extends NumericColumnType[Double] with Product with Serializable

    Permalink
  10. object IntColumnType extends NumericColumnType[Int] with Product with Serializable

    Permalink
  11. object LocalDateColumnType extends NonNumericColumnType[LocalDate] with Product with Serializable

    Permalink
  12. object LongColumnType extends NumericColumnType[Long] with Product with Serializable

    Permalink
  13. object MappedColumnType

    Permalink
  14. object MaterializeColumnTypeMacro extends Serializable

    Permalink
  15. object OptionColumnType extends Serializable

    Permalink
  16. object Setter

    Permalink
  17. object StringColumnType extends NonNumericColumnType[String] with Product with Serializable

    Permalink
  18. object TableFunctionApplyImplementations

    Permalink
  19. package operations

    Permalink
  20. package syntax

    Permalink

Ungrouped