easysql.dsl

package easysql.dsl

Members list

Concise view

Type members

Classlikes

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

Attributes

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

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
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]
class Object
trait Matchable
class Any
sealed trait AnyTable

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class JoinTable
class TableSchema[E]
case class BetweenExpr[T <: SqlDataType](expr: Expr[_], start: Expr[_], end: Expr[_], not: Boolean) extends Expr[Boolean]

Attributes

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

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
class Object
trait Matchable
class Any
case class CaseBranch[T](expr: Expr[_], thenValue: Expr[_])

Attributes

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

Attributes

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

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[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, N <: String](tableName: String, columnName: String, identName: N) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
class Object
trait Matchable
class Any
case class CustomColumn[T, D <: SqlDataType](columnName: String, serializer: CustomSerializer[T, D]) extends StaticAnnotation

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
trait CustomSerializer[T, D]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
sealed trait Expr[T <: SqlDataType]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AggExpr[T]
class BetweenExpr[T]
class BinaryExpr[T]
class CaseExpr[T]
class CastExpr[T]
class ColumnExpr[T, N]
class FuncExpr[T]
class IdentExpr[T]
class InExpr[T]
class ListExpr[T]
class LiteralExpr[T]
object NullExpr.type
class OverExpr[T]
class PrimaryKeyExpr[T, N]
class SubQueryExpr[T]
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
object unsafeOperator.type
case class FuncExpr[T <: SqlDataType](name: String, args: List[Expr[_]]) extends Expr[T]

Attributes

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

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
class Object
trait Matchable
class Any
case class InExpr[T <: SqlDataType](expr: Expr[_], inExpr: Expr[_], not: Boolean) extends Expr[Boolean]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[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 JoinTable(left: AnyTable, joinType: SqlJoinType, right: AnyTable, onCondition: Option[Expr[Boolean]]) 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[Expr[_]]) extends Expr[T]

Attributes

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

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
class Object
trait Matchable
class Any
case object NullExpr extends Expr[Nothing]

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Expr[Nothing]
class Object
trait Matchable
class Any
Self type
case class OrderBy(expr: Expr[_], order: SqlOrderByOption)

Attributes

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

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[T]
class Object
trait Matchable
class Any
case class PrimaryKey(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 PrimaryKeyExpr[T <: SqlDataType, N <: String](tableName: String, columnName: String, identName: N, inc: Boolean) extends Expr[T]

Attributes

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

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
case class SubQueryExpr[T <: SqlDataType](query: Query[(T), _]) extends Expr[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr[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
class TableSchema[E <: Product](`__tableName`: String, `__aliasName`: Option[String], `__cols`: List[ColumnExpr[_, _]]) extends AnyTable with Dynamic

Attributes

Graph
Supertypes
trait Dynamic
trait AnyTable
class Object
trait Matchable
class Any
object unsafeOperator extends ExprOperator[_]

Attributes

Graph
Supertypes
trait ExprOperator[_]
class Object
trait Matchable
class Any
Self type

Types

type AliasNames[T <: Tuple] = HasAliasName[T] match { case true => ExtractAliasNames[T] case false => 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 SqlDataType => t case Option[o] => o match { case SqlDataType => o } case Any => Nothing } 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[_$5, n] *: t => n *: ExtractAliasNames[t] case ColumnExpr[_$6, n] *: t => n *: ExtractAliasNames[t] case PrimaryKeyExpr[_$7, 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 HasAliasName[T <: Tuple] = T match { case AliasExpr[_$2, n] *: t => true && HasAliasName[t] case ColumnExpr[_$3, n] *: t => true && HasAliasName[t] case PrimaryKeyExpr[_$4, n] *: t => true && HasAliasName[t] case EmptyTuple => true case Any => false }
type InverseMap[X <: Tuple] = X match { case Expr[x] *: t => x *: InverseMap[t] case AliasExpr[x, _$1] *: t => x *: InverseMap[t] case TableSchema[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 != ""
type ResultType[T <: Tuple] = T match { case (t) => Option[t] case Any => MapOption[T] }
type UnionTo[A, B] = A match { case B => B case SqlNumberType => B match { case SqlNumberType => BigDecimal } }
type UnionType[X <: Tuple, Y <: Tuple] = (X, Y) match { case (a *: at, b *: bt) => UnionTo[a, b] *: UnionType[at, bt] case (EmptyTuple, EmptyTuple) => EmptyTuple }
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](query: Select[(T), _]): FuncExpr[Boolean]
def any[T <: SqlDataType](query: Select[(T), _]): FuncExpr[Boolean]
inline def asTable[T <: Product]: TableSchema[T]
def avg[T <: SqlNumberType](expr: Expr[T]): AggExpr[BigDecimal]
def caseWhen[T <: SqlDataType](branches: CaseBranch[T]*): CaseExpr[T]
def cast[T <: SqlDataType](expr: Expr[_], castType: String): CastExpr[T]
def col[T <: SqlDataType](columnName: String): IdentExpr[T]
def count(): AggExpr[Long]
def count(expr: Expr[_]): AggExpr[Long]
def countDistinct(expr: Expr[_]): AggExpr[Long]
def cube(expr: Expr[_]*): FuncExpr[Nothing]
inline def delete[T <: Product](pk: SqlDataType | Tuple): Delete
def deleteFrom(table: TableSchema[_]): Delete
def denseRank(): AggExpr[Long]
def dynamicSelect(columns: Expr[_]*): Select[EmptyTuple, EmptyTuple]
def exists[T <: SqlDataType](query: Select[(T), _]): FuncExpr[Boolean]
inline def find[T <: Product](pk: SqlDataType | Tuple): Select[(T), EmptyTuple]
def from[P <: Product](table: TableSchema[P]): Select[(P), EmptyTuple]
def groupingSets(expr: Expr[_] | Tuple | Unit*): FuncExpr[Nothing]
inline def insert[T <: Product](entities: T*): Insert[EmptyTuple, InsertEntity]
inline def insert[T <: Product](eneityList: List[T]): Insert[EmptyTuple, InsertEntity]
def insertInto(table: TableSchema[_])(columns: Tuple): Insert[InverseMap[Tuple], Nothing]
def max[T <: SqlDataType](expr: Expr[T]): AggExpr[T]
def min[T <: SqlDataType](expr: Expr[T]): AggExpr[T]
def notExists[T <: SqlDataType](query: Select[(T), _]): FuncExpr[Boolean]
def rank(): AggExpr[Long]
def rollup(expr: Expr[_]*): FuncExpr[Nothing]
def rowNumber(): AggExpr[Long]
inline def save[T <: Product](entity: T): Save
def select[U <: Tuple](items: U): Select[InverseMap[U], AliasNames[U]]
def select[I <: SqlDataType, E <: Expr[I]](item: E): Select[(I), AliasNames[(E)]]
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](query: Select[(T), _]): FuncExpr[Boolean]
def sum[T <: SqlNumberType](expr: Expr[T]): AggExpr[BigDecimal]
def table(name: String): TableSchema[Nothing]
def truncate(table: TableSchema[_]): Truncate
def update(table: TableSchema[_]): Update
inline def update[T <: Product](entity: T, skipNone: Boolean): Update
def value[T <: SqlDataType](v: T): LiteralExpr[T]
def withQuery(query: AliasQuery[_, _]*): With[EmptyTuple]

Givens

Givens

Extensions

Extensions

extension [T <: SqlDataType](expr: ColumnExpr[T, _] | IdentExpr[T])
infix def to(value: Expr[T]): (ColumnExpr[T, _] | IdentExpr[T], Expr[T])
infix def to(value: T): (ColumnExpr[T, _] | IdentExpr[T], Expr[T])
extension (s: Select[_, _])
def toEsDsl: String
def toMongoDsl: String
extension (s: StringContext)
def sql(args: SqlDataType | List[SqlDataType]*): String