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]], 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

Companion:
object
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 PrimaryKeyColumnExpr[T, Name]
class SubQueryExpr[T]
class TableColumnExpr[T, Name]
object Expr

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Expr.type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object boolOperator.type
object dateOperator.type
object stringOperator.type
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, Name <: String](table: String, column: String, ident: Name, schema: TableSchema[_], 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 PrimaryKeyColumnExpr[T, Name]
class SubQueryExpr[T]
class TableColumnExpr[T, Name]
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, Name <: String](table: String, column: String, ident: Name, 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 ElementType[T <: Tuple, N <: Tuple, Name <: String] = (T, N) match { case (t *: tt, n *: nt) => n == Name match { case true => t match { case SqlDataType => t case Option[o] => o match { 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[_$1, n] *: t => n *: ExtractAliasNames[t] case TableColumnExpr[_$2, n] *: t => n *: ExtractAliasNames[t] case PrimaryKeyColumnExpr[_$3, 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 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) => Option[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 => BigDecimal } case Any => B match { case A => A } }
type UpdateType[T <: SqlDataType] = T match { case SqlNumberType => SqlNumberType case String => String case Boolean => Boolean case Date => Date | String }

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[BigDecimal]
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[Long]
def count(query: Expr[_]): AggFunctionExpr[Long]
def countDistinct(query: Expr[_]): AggFunctionExpr[Long]
def cube(expr: Expr[_]*): NormalFunctionExpr[Nothing]
inline def delete[T <: Product](pk: SqlDataType | Tuple): Delete
def deleteFrom(table: TableSchema[_]): Delete
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[(T), InsertEntity]
inline def insert[T <: Product](eneityList: List[T]): Insert[(T), InsertEntity]
def insertInto(table: TableSchema[_])(columns: Tuple): Insert[InverseMap[Tuple], Nothing]
def max[T <: SqlDataType](query: Expr[T]): AggFunctionExpr[T]
def min[T <: SqlDataType](query: Expr[T]): AggFunctionExpr[T]
def notExists(select: SelectQuery[_, _]): SubQueryPredicateExpr[Boolean]
def rank(): AggFunctionExpr[Long]
def rollup(expr: Expr[_]*): NormalFunctionExpr[Nothing]
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: TableColumnExpr[I, N]): Select[(I), (N)]
def select[I <: SqlDataType, N <: String](item: PrimaryKeyColumnExpr[I, N]): Select[(I), (N)]
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[BigDecimal]
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]

Extensions

Extensions

extension [T <: SqlDataType](e: TableColumnExpr[T, _] | ColumnExpr[T])
def to[V <: UpdateType[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