org.easysql.dsl

Members list

Concise view

Type members

Classlikes

case class AggFunctionExpr[T <: SqlDataType](name: String, args: List[Expr[_]], distinct: Boolean, attributes: Map[String, Expr[_]], orderBy: List[OrderBy]) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class AliasExpr[T <: SqlDataType, Alias <: String](expr: Expr[T], name: Alias) extends SelectItem[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait SelectItem[T]
class Object
trait Matchable
class Any
object AllColumn

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class AllColumnExpr(owner: Option[String]) extends Expr[Nothing]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[Nothing]
trait SelectItem[Nothing]
class Object
trait Matchable
class Any
sealed trait AnyTable

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class BetweenExpr[T <: SqlDataType](query: Expr[_], start: T | Expr[_] | SelectQuery[_, _], end: T | Expr[_] | SelectQuery[_, _], isNot: Boolean) extends Expr[Boolean]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[Boolean]
trait SelectItem[Boolean]
class Object
trait Matchable
class Any
case class BinaryExpr[T <: SqlDataType](left: Expr[_], operator: SqlBinaryOperator, right: Expr[_]) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class CaseBranch[T <: SqlDataType](query: Expr[_], thenValue: T | Expr[T] | SelectQuery[(T), _])

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class CaseExpr[T <: SqlDataType](conditions: List[CaseBranch[T]], var default: T | Expr[T] | SelectQuery[(T), _]) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class CastExpr[T <: SqlDataType](query: Expr[_], castType: String) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class Column(columnName: String) extends StaticAnnotation

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
case class ColumnExpr[T <: SqlDataType](column: String) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class ConstExpr[T <: SqlDataType](value: T) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
sealed trait Expr[T <: SqlDataType] extends SelectItem[T]

Attributes

Graph
Supertypes
trait SelectItem[T]
class Object
trait Matchable
class Any
Known subtypes
class BetweenExpr[T]
class BinaryExpr[T]
class CaseExpr[T]
class CastExpr[T]
class ColumnExpr[T]
class ConstExpr[T]
class InListExpr[T]
class ListExpr[T]
class OverExpr[T]
class SubQueryExpr[T]
case class InListExpr[T <: SqlDataType](query: Expr[_], list: List[T | Expr[_] | SelectQuery[_, _]], isNot: Boolean) extends Expr[Boolean]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[Boolean]
trait SelectItem[Boolean]
class Object
trait Matchable
class Any
case class InSubQueryExpr[T <: SqlDataType](query: Expr[T], subQuery: SelectQuery[_, _], isNot: Boolean) extends Expr[Boolean]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[Boolean]
trait SelectItem[Boolean]
class Object
trait Matchable
class Any
case class IncrKey(columnName: String) extends StaticAnnotation

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
case class JoinTableSchema(left: AnyTable, joinType: SqlJoinType, right: AnyTable, var onCondition: Option[Expr[_]]) extends AnyTable

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait AnyTable
class Object
trait Matchable
class Any
case class ListExpr[T <: SqlDataType](list: List[T | Expr[_] | SelectQuery[_, _]]) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class NormalFunctionExpr[T <: SqlDataType](name: String, args: List[Expr[_]]) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class OrderBy(query: Expr[_], order: SqlOrderByOption)

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class OverExpr[T <: SqlDataType](function: AggFunctionExpr[_], partitionBy: ListBuffer[Expr[_]], orderBy: ListBuffer[OrderBy]) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class PrimaryKey(columnName: String, generator: () => Any) extends StaticAnnotation

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
case class PrimaryKeyColumnExpr[T <: SqlDataType](table: String, column: String, schema: TableSchema[_], var isIncr: Boolean) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
trait SelectItem[T]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AliasExpr[T, Alias]
trait Expr[T]
class BetweenExpr[T]
class BinaryExpr[T]
class CaseExpr[T]
class CastExpr[T]
class ColumnExpr[T]
class ConstExpr[T]
class InListExpr[T]
class ListExpr[T]
class OverExpr[T]
class SubQueryExpr[T]
trait TableSchema[E]
case class SubQueryExpr[T <: SqlDataType](selectQuery: SelectQuery[(T), _]) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class SubQueryPredicateExpr[T <: SqlDataType](query: SelectQuery[_, _], predicate: SqlSubQueryPredicate) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
case class Table(tableName: String) extends StaticAnnotation

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
case class TableColumnExpr[T <: SqlDataType](table: String, column: String, schema: TableSchema[_]) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
trait SelectItem[T]
class Object
trait Matchable
class Any
trait TableSchema[E <: Product] extends AnyTable with Dynamic with SelectItem[E]

Attributes

Graph
Supertypes
trait SelectItem[E]
trait Dynamic
trait AnyTable
class Object
trait Matchable
class Any

Types

type Append[X, Y] = X match { case x *: xs => x *: Append[xs, Y] case EmptyTuple => Y *: EmptyTuple case Any => X *: Y *: EmptyTuple }
type ElementType[T <: Tuple, N <: Tuple, Name <: String] = (T, N) match { case (t *: tt, n *: nt) => n == Name match { case true => t match { case SqlNumberType => Number case SqlDataType => t case Option[o] => o match { case SqlNumberType => Number case SqlDataType => o } } case false => ElementType[tt, nt, Name] } case (EmptyTuple, EmptyTuple) => Nothing }
type ExprType[T <: Tuple] = T match { case h *: t => Expr[h] *: ExprType[t] case EmptyTuple => EmptyTuple }
type ExtractAliasNames[T <: Tuple] = T match { case AliasExpr[_$11, n] *: t => n *: ExtractAliasNames[t] case Any => EmptyTuple }
type FindTypeByName[T <: Tuple, I <: Int, Name <: String] = I >= 0 match { case true => Elem[T, I] match { case (t, n) => n == Name match { case true => t case false => FindTypeByName[T, I - 1, Name] } case Any => Nothing } case false => Nothing }
type FlatType[T, Bound, F[_ <: Bound]] = T match { case x *: xs => x match { case F[t] => t *: FlatType[xs, Bound, F] case Tuple => FlatType[x, Bound, F] *: FlatType[xs, Bound, F] case Any => x *: FlatType[xs, Bound, F] } case EmptyTuple => EmptyTuple case F[t] => t case Any => T }
type InverseMap[X <: Tuple] = X match { case SelectItem[x] *: t => x *: InverseMap[t] case EmptyTuple => EmptyTuple }
type MapOption[T <: Tuple] = T match { case h *: t => Option[h] *: MapOption[t] case EmptyTuple => EmptyTuple }
type NonEmpty[T <: String] = T == "" match { case false => Any case true => Nothing }
type QueryType[T <: Tuple | Expr[_] | TableSchema[_]] = T match { case h *: t => h *: t case Any => (T) }
type RecursiveInverseMap[X <: Tuple] = X match { case x *: t => x match { case Tuple => Concat[RecursiveInverseMap[x], RecursiveInverseMap[t]] case SelectItem[y] => y *: RecursiveInverseMap[t] } case EmptyTuple => EmptyTuple }
type ResultType[T <: Tuple] = T match { case (t) => t case Any => MapOption[T] }
type Union[X <: Tuple, Y <: Tuple] = (X, Y) match { case (a *: at, b *: bt) => UnionTo[a, b] *: Union[at, bt] case (EmptyTuple, EmptyTuple) => EmptyTuple }
type UnionTo[A, B] = A match { case B => B case SqlNumberType => B match { case SqlNumberType => Number } case Any => B match { case A => A } }

Value members

Concrete methods

def all[T <: SqlDataType](select: SelectQuery[(T), _]): SubQueryPredicateExpr[T]
def any[T <: SqlDataType](select: SelectQuery[(T), _]): SubQueryPredicateExpr[T]
inline def asTable[T <: Product]: TableSchema[T]
def avg[T <: SqlNumberType](query: Expr[T]): AggFunctionExpr[Number]
def caseWhen[T <: SqlDataType](conditions: CaseBranch[T]*): CaseExpr[T]
def cast[T <: SqlDataType](expr: Expr[_], castType: String): CastExpr[T]
def col[T <: SqlDataType](column: String): ColumnExpr[T]
def const[T <: SqlDataType](v: T): ConstExpr[T]
def count(): AggFunctionExpr[Number]
def count(query: Expr[_]): AggFunctionExpr[Number]
def countDistinct(query: Expr[_]): AggFunctionExpr[Number]
def cube(expr: Expr[_]*): NormalFunctionExpr[Nothing]
inline def delete[T <: Product](pk: SqlDataType | Tuple): Delete
def deleteFrom(table: TableSchema[_]): Delete
def denseRank(): AggFunctionExpr[Number]
def dynamicSelect(columns: Expr[_]*): Select[EmptyTuple, EmptyTuple]
def exists(select: SelectQuery[_, _]): SubQueryPredicateExpr[Boolean]
inline def findQuery[T <: Product](pk: SqlDataType | Tuple): Select[(T), _]
def from[P <: Product](table: TableSchema[P]): Select[(P), EmptyTuple]
def groupingSets(expr: Expr[_] | Tuple*): NormalFunctionExpr[Nothing]
inline def insert[T <: Product](entities: T*): Insert[_, InsertEntity]
def insertInto(table: TableSchema[_])(columns: Tuple): Insert[InverseMap[Tuple], Nothing]
def max[T <: SqlNumberType](query: Expr[T]): AggFunctionExpr[Number]
def min[T <: SqlNumberType](query: Expr[T]): AggFunctionExpr[Number]
def notExists(select: SelectQuery[_, _]): SubQueryPredicateExpr[Boolean]
inline def query[T <: Product](using m: ProductOf[T]): Query[TableSchema[T]]
def rank(): AggFunctionExpr[Number]
def rollup(expr: Expr[_]*): NormalFunctionExpr[Nothing]
def rowNumber(): AggFunctionExpr[Number]
inline def save[T <: Product](entity: T): Save
def select[U <: Tuple](items: U): Select[RecursiveInverseMap[U], ExtractAliasNames[U]]
def select[I <: SqlDataType](item: Expr[I]): Select[(I), EmptyTuple]
def select[I <: SqlDataType, N <: String](item: AliasExpr[I, N]): Select[(I), (N)]
def select[P <: Product](table: TableSchema[P]): Select[(P), EmptyTuple]
def some[T <: SqlDataType](select: SelectQuery[(T), _]): SubQueryPredicateExpr[T]
def sum[T <: SqlNumberType](query: Expr[T]): AggFunctionExpr[Number]
def table(name: String): TableSchema[Nothing]
def truncate(table: TableSchema[_]): Truncate
def update(table: TableSchema[_]): Update
inline def update[T <: Product](entity: T, skipNull: Boolean): Update
def value[T <: SqlDataType](v: T): ConstExpr[T]

Givens

Givens

given boolToExpr: Conversion[Boolean, ConstExpr[Boolean]]
given dateToExpr: Conversion[Date, ConstExpr[Date]]
given decimalToExpr: Conversion[BigDecimal, ConstExpr[Number]]
given doubleToExpr: Conversion[Double, ConstExpr[Number]]
given floatToExpr: Conversion[Float, ConstExpr[Number]]
given intToExpr: Conversion[Int, ConstExpr[Number]]
given longToExpr: Conversion[Long, ConstExpr[Number]]
given queryToExpr[T <: SqlDataType]: Conversion[SelectQuery[(T), _], SubQueryExpr[T]]
given stringToDateExpr: Conversion[String, ConstExpr[Date]]
given stringToExpr: Conversion[String, ConstExpr[String]]

Extensions

Extensions

extension [T <: SqlNumberType](e: Expr[T])
def %[V <: SqlNumberType](value: V): BinaryExpr[Number]
def %[V <: SqlNumberType](expr: Expr[V]): BinaryExpr[Number]
def %[V <: SqlNumberType](subQuery: SelectQuery[(V), _]): BinaryExpr[Number]
def *[V <: SqlNumberType](value: V): BinaryExpr[Number]
def *[V <: SqlNumberType](expr: Expr[V]): BinaryExpr[Number]
def *[V <: SqlNumberType](subQuery: SelectQuery[(V), _]): BinaryExpr[Number]
def +[V <: SqlNumberType](value: V): BinaryExpr[Number]
def +[V <: SqlNumberType](expr: Expr[V]): BinaryExpr[Number]
def +[V <: SqlNumberType](subQuery: SelectQuery[(V), _]): BinaryExpr[Number]
def -[V <: SqlNumberType](value: V): BinaryExpr[Number]
def -[V <: SqlNumberType](expr: Expr[V]): BinaryExpr[Number]
def -[V <: SqlNumberType](subQuery: SelectQuery[(V), _]): BinaryExpr[Number]
def /[V <: SqlNumberType](value: V): BinaryExpr[Number]
def /[V <: SqlNumberType](expr: Expr[V]): BinaryExpr[Number]
def /[V <: SqlNumberType](subQuery: SelectQuery[(V), _]): BinaryExpr[Number]
extension [T <: String](e: Expr[T])
infix def like(value: String): BinaryExpr[Boolean]
infix def like(expr: Expr[String]): BinaryExpr[Boolean]
infix def notLike(value: String): BinaryExpr[Boolean]
infix def notLike(expr: Expr[String]): BinaryExpr[Boolean]
extension [T <: SqlDataType](e: TableColumnExpr[T] | ColumnExpr[T])
def to[V <: T](value: V | Expr[V] | SelectQuery[(V), _]): (TableColumnExpr[T] | ColumnExpr[T], V | Expr[V] | SelectQuery[(V), _])
extension (s: StringContext)
def sql(args: SqlDataType | List[SqlDataType]*): String
extension (s: Select[_, _])
def toEsDsl: String
def toMongoDsl: String
extension [E <: Product, T <: TableSchema[E]](t: T)
infix inline def as(aliasName: String)(using NonEmpty[String] =:= Any): T
infix inline def unsafeAs(aliasName: String): T