sqlest

ast

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

    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]

    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

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

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

    Trait representing a column type read directly from the database.

  5. trait BaseTable extends AnyRef

    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

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

    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

    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

    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

    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

    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

    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

  14. sealed trait ColumnType[A] extends AnyRef

    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. case class ColumnTypeEquivalence[A, B](leftOption: Boolean, rightOption: Boolean) extends Product with Serializable

    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

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

    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

    An outer join between two tables.

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

  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

    Binary prefix, infix operators, e.g.

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

  21. trait EnumerationMappedColumnTypes extends AnyRef

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

  23. sealed trait Group extends AnyRef

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

    Binary functions and operators, e.g.

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

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

    An inner join between two tables.

  26. sealed trait Insert extends Command

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

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

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

    A join over two relations.

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

    A left join between two tables.

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

    Literal column values, e.g.

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

  32. trait LocalDateMappedColumnTypes extends AnyRef

  33. trait LowPriorityImplicits extends AnyRef

  34. trait MappedColumnType[A, B] extends ColumnType[A]

    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.

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

    Standard set of MappedColumnTypes for various column types:

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

  37. sealed trait NonNumericColumnType[A] extends BaseColumnType[A]

  38. sealed trait NumericColumnType[A] extends BaseColumnType[A]

  39. trait NumericMappedColumnTypes extends AnyRef

  40. sealed trait Operation extends AnyRef

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

    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.

  42. trait OptionColumnTypes extends AnyRef

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

  44. trait OrderedColumnType extends AnyRef

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

    An outer join between two tables.

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

    Unary postfix functions and operators, e.g.

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

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

    Unary prefix functions and operators, e.g.

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

  48. trait Query extends Operation

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

    Used for refering to another column by alias

  50. sealed trait Relation extends AnyRef

    A source of columns from the database.

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

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

    A right join between two tables.

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

    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

  53. trait ScalarFunctions extends AnyRef

  54. 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, union: List[Union[_]] = Nil, subselectAlias: Option[String] = None)(implicit aliasedColumns: AliasedColumns[A]) extends Relation with Query with ColumnSyntax with Product with Serializable

    A select statement or subselect.

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

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

  56. case class Setter[A, B](column: TableColumn[A], value: Column[B])(implicit columnEquivalence: ColumnTypeEquivalence[A, B]) extends Product with Serializable

  57. trait StringMappedColumnTypes extends AnyRef

  58. abstract class Table extends Relation with BaseTable

    A database table.

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

    Columns from tables.

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

    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

  61. trait TableFunctions extends AnyRef

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

  63. trait TupleGroups extends AnyRef

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

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

    An update statement.

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

    A when clause in a CaseColumn *

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

    Defines a window for use within an OLAP function

Value Members

  1. object AliasTableImpl

  2. object AliasedColumns

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

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

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

  6. object ColumnType

  7. object ColumnTypeEquivalence extends LowPriorityImplicits with Serializable

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

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

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

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

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

  13. object MappedColumnType

  14. object OptionColumnType extends Serializable

  15. object StringColumnType extends NonNumericColumnType[String] with Product with Serializable

  16. object TableFunctionApplyImplementations

  17. package operations

  18. package syntax

Ungrouped