Package-level declarations

Types

Link copied to clipboard

Base class representing an SQL query that returns a ResultSet when executed.

Link copied to clipboard
class Alias<out T : Table>(val delegate: T, val alias: String) : Table

Represents a temporary SQL identifier, alias, for a delegate table.

Link copied to clipboard
class AndBitOp<T, S : T>(val expr1: Expression<T>, val expr2: Expression<S>, val columnType: IColumnType<T & Any>) : ExpressionWithColumnType<T>

Represents an SQL operator that performs a bitwise and on expr1 and expr2.

Link copied to clipboard

Represents a logical operator that performs an and operation between all the specified expressions.

Link copied to clipboard
class ArrayColumnType<T, R : List<Any?>>(val delegate: ColumnType<T & Any>, val maximumCardinality: List<Int>? = null, val dimensions: Int = 1) : ColumnType<R>

Multi-dimensional array column type for storing a collection of nested elements.

Link copied to clipboard
class AutoIncColumnType<T>(val delegate: ColumnType<T>, _autoincSeq: String?, fallbackSeqName: String) : IColumnType<T>

Auto-increment column type.

Link copied to clipboard
class Avg<T : Comparable<T>, S : T?>(val expr: Expression<S>, scale: Int) : Function<BigDecimal?> , WindowFunction<BigDecimal?>

Represents an SQL function that returns the average (arithmetic mean) of all non-null input values, or null if there are no non-null values.

Link copied to clipboard

Binary column for storing binary strings of variable and unlimited length.

Link copied to clipboard
class Between(val expr: Expression<*>, val from: Expression<*>, val to: Expression<*>) : Op<Boolean> , ComplexExpression, Op.OpBoolean

Represents an SQL operator that checks if the specified expr is between the values from and to.

Link copied to clipboard
abstract class BiCompositeColumn<C1, C2, T>(column1: Column<C1>, column2: Column<C2>, val transformFromValue: (T) -> Pair<C1?, C2?>, val transformToValue: (Any?, Any?) -> T, nullable: Boolean = false) : CompositeColumn<T>

Extension of CompositeColumn that consists of two columns, column1 and column2.

Link copied to clipboard
open class BinaryColumnType(val length: Int) : BasicBinaryColumnType

Binary column for storing binary strings of a specific length.

Link copied to clipboard
class BlobColumnType(val useObjectIdentifier: Boolean = false) : ColumnType<ExposedBlob>

Binary column for storing BLOBs.

Link copied to clipboard

Boolean column for storing boolean values.

Link copied to clipboard

Numeric column for storing 1-byte integers.

Link copied to clipboard
class Case(val value: Expression<*>? = null)

Represents an SQL function that allows the comparison of value to chained conditional clauses.

Link copied to clipboard
class CaseWhen<T>(val value: Expression<*>?)

Represents an SQL function that allows the comparison of value to chained conditional clauses.

Link copied to clipboard
class CaseWhenElse<T>(val caseWhen: CaseWhen<T>, val elseResult: Expression<T>) : ExpressionWithColumnType<T> , ComplexExpression

Represents an SQL function that steps through conditions, and either returns a value when the first condition is met or returns elseResult if all conditions are false.

Link copied to clipboard
class Cast<T>(val expr: Expression<*>, columnType: IColumnType<T & Any>) : Function<T>

Represents an SQL function that specifies a conversion from one data type to another.

Link copied to clipboard

Character column for storing single characters.

Link copied to clipboard
open class CharColumnType(val colLength: Int = 255, val collate: String? = null) : StringColumnType

Character column for storing strings with the exact colLength length using the specified collate type.

Link copied to clipboard
class CharLength<T : String?>(val expr: Expression<T>) : Function<Int?>

Represents an SQL function that returns the length of expr, measured in characters, or null if expr is null.

Link copied to clipboard
data class CheckConstraint(val tableName: String, val checkName: String, val checkOp: String) : DdlAware

Represents a check constraint.

Link copied to clipboard
class Coalesce<T, S : T?>(expr: ExpressionWithColumnType<S>, alternate: Expression<out T>, others: Expression<out T>) : Function<T>

Represents an SQL function that returns the first of its arguments that is not null.

Link copied to clipboard
class Column<T>(val table: Table, val name: String, val columnType: IColumnType<T & Any>) : ExpressionWithColumnType<T> , DdlAware, Comparable<Column<*>>

Represents a column.

Link copied to clipboard
data class ColumnDiff(val nullability: Boolean, val autoInc: Boolean, val defaults: Boolean, val caseSensitiveName: Boolean, val sizeAndScale: Boolean)

Represents differences between a column definition and database metadata for the existing column.

Link copied to clipboard
abstract class ColumnSet : FieldSet

Represents a set of columns.

Link copied to clipboard

An interface defining the transformation between a source column type and a target type.

Link copied to clipboard
abstract class ColumnType<T>(var nullable: Boolean = false) : IColumnType<T>

Standard column type.

Link copied to clipboard

A class that handles the transformation between a source column type and a target type.

Link copied to clipboard
abstract class ComparisonOp(val expr1: Expression<*>, val expr2: Expression<*>, val opSign: String) : Op<Boolean> , ComplexExpression, Op.OpBoolean

Represents a comparison between expr1 and expr2 using the given SQL opSign.

Link copied to clipboard

Marker interface which indicates that expression should be wrapped with braces when used in compound operators

Link copied to clipboard
abstract class CompositeColumn<T> : Expression<T>

Composite column represents multiple tightly related standard columns, which behave like a single column for the user

Link copied to clipboard

Class representing one or more SqlLoggers.

Link copied to clipboard

Represent a logical operator that performs an operation between all the specified expressions. This is the base class for the and and or operators:

Link copied to clipboard
class Concat(val separator: String, val expr: Expression<*>) : Function<String>

Represents an SQL function that concatenates the text representations of all non-null input values from expr, separated by separator.

Link copied to clipboard
class Count(val expr: Expression<*>, val distinct: Boolean = false) : Function<Long> , WindowFunction<Long>

Represents an SQL function that returns the number of input rows for which the value of expr is not null.

Link copied to clipboard
class CumeDist(scale: Int = 2) : WindowFunction<BigDecimal>

Represents an SQL function that Returns the cumulative distribution, that is (number of partition rows preceding or peers with current row) / (total partition rows). The value thus ranges from 1/N to 1. scale represents decimal digits count in the fractional part of result.

Link copied to clipboard

Represents an SQL window function frame bound that is CURRENT ROW or one of FOLLOWING forms.

Link copied to clipboard

Represents an SQL window function frame bound that is CURRENT ROW or one of PRECEDING forms.

Link copied to clipboard

Represents an CURRENT ROW window function frame bound.

Link copied to clipboard
class CustomEnumerationColumnType<T : Enum<T>>(val name: String, val sql: String?, val fromDb: (Any) -> T, val toDb: (T) -> Any) : ColumnType<T>

Enumeration column for storing enums of type T using the custom SQL type sql.

Link copied to clipboard
open class CustomFunction<T>(val functionName: String, columnType: IColumnType<T & Any>, val expr: Expression<*>) : Function<T>

Represents a custom SQL function.

Link copied to clipboard
open class CustomOperator<T>(val operatorName: String, columnType: IColumnType<T & Any>, val expr1: Expression<*>, val expr2: Expression<*>) : Function<T>

Represents a custom SQL binary operator.

Link copied to clipboard
class Database

Class representing the underlying database to which connections are made and on which transaction tasks are performed.

Link copied to clipboard

A configuration class for a Database.

Link copied to clipboard

Represents an ExposedConnection that is loaded whenever a connection is accessed by a Database instance.

Link copied to clipboard
interface DdlAware

Common interface for database objects that can be created, modified and dropped.

Link copied to clipboard
class DecimalColumnType(val precision: Int, val scale: Int) : ColumnType<BigDecimal>

Numeric column for storing numbers with the specified precision and scale.

Link copied to clipboard

Represents an SQL function that returns the rank of the current row, without gaps; this function effectively counts peer groups.

Link copied to clipboard
class DivideOp<T, S : T>(dividend: Expression<T>, divisor: Expression<S>, columnType: IColumnType<T & Any>) : CustomOperator<T>

Represents an SQL operator that divides expr1 by expr2.

Link copied to clipboard

Numeric column for storing 8-byte (double precision) floating-point numbers.

Link copied to clipboard

Represents a SizedIterable that is empty and cannot be iterated over.

Link copied to clipboard
class EntityIDColumnType<T : Any>(val idColumn: Column<T>) : ColumnType<EntityID<T>>

Identity column type for storing unique EntityID values.

Link copied to clipboard
class EnumerationColumnType<T : Enum<T>>(val klass: KClass<T>) : ColumnType<T>

Enumeration column for storing enums of type klass by their ordinal.

Link copied to clipboard
class EnumerationNameColumnType<T : Enum<T>>(val klass: KClass<T>, val colLength: Int) : ColumnType<T>

Enumeration column for storing enums of type klass by their name.

Link copied to clipboard
class EqOp(val expr1: Expression<*>, val expr2: Expression<*>) : ComparisonOp

Represents an SQL operator that checks if expr1 is equals to expr2.

Link copied to clipboard
class EqSubQueryOp<T>(expr: Expression<T>, query: AbstractQuery<*>) : SubQueryOp<T>

Represents an SQL operator that checks if expr is equals to single value returned from query.

Link copied to clipboard
class Except(firstStatement: AbstractQuery<*>, val secondStatement: AbstractQuery<*>) : SetOperation

Represents an SQL operation that returns the distinct results of firstStatement that are not common to secondStatement.

Link copied to clipboard
class Exists(val query: AbstractQuery<*>) : Op<Boolean> , Op.OpBoolean

Represents an SQL operator that checks if query returns at least one row.

Link copied to clipboard

API marked with this annotation is experimental. Any behavior associated with its use is not guaranteed to be stable.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class ExperimentalKeywordApi

API marked with this annotation is experimental. Any behavior associated with its use is not guaranteed to be stable.

Link copied to clipboard
open class ExplainQuery(val analyze: Boolean, val options: String?, internalStatement: Statement<*>) : Statement<ResultSet> , Iterable<ExplainResultRow>

Represents the SQL query that obtains information about a statement execution plan.

Link copied to clipboard
class ExplainResultRow(val fieldIndex: Map<String, Int>, data: Array<Any?>)

A row of data representing a single record retrieved from a database result set about a statement execution plan.

Link copied to clipboard
abstract class Expression<T>

Represents an SQL expression of type T.

Link copied to clipboard
class ExpressionAlias<T>(val delegate: Expression<T>, val alias: String) : Expression<T>

Represents a temporary SQL identifier, alias, for a delegate expression.

Link copied to clipboard

Represents an SQL expression of type T, but with a specific column type.

Link copied to clipboard
interface FieldSet

Represents a set of expressions, contained in the given column set.

Link copied to clipboard

A conditional expression used as a filter when creating a partial index.

Link copied to clipboard

Represents an SQL function that returns expr evaluated at the row that is the first row of the window frame.

Link copied to clipboard

Numeric column for storing 4-byte (single precision) floating-point numbers.

Link copied to clipboard
data class ForeignKeyConstraint(val references: Map<Column<*>, Column<*>>, onUpdate: ReferenceOption?, onDelete: ReferenceOption?, name: String?) : DdlAware

Represents a foreign key constraint.

Link copied to clipboard
abstract class Function<T>(val columnType: IColumnType<T & Any>) : ExpressionWithColumnType<T>

Represents an SQL function.

Link copied to clipboard
class GreaterEqOp(val expr1: Expression<*>, val expr2: Expression<*>) : ComparisonOp

Represents an SQL operator that checks if expr1 is greater than or equal to expr2.

Link copied to clipboard
class GreaterOp(val expr1: Expression<*>, val expr2: Expression<*>) : ComparisonOp

Represents an SQL operator that checks if expr1 is greater than expr2.

Link copied to clipboard
class GroupConcat<T : String?>(val expr: Expression<T>, val separator: String?, val distinct: Boolean, val orderBy: Pair<Expression<*>, SortOrder>) : Function<String>

Represents an SQL function that concatenates the text representation of all non-null input values of each group from expr, separated by separator

Link copied to clipboard
interface IColumnType<T>

Interface common to all column types.

Link copied to clipboard
interface IDateColumnType

Marker interface for date/datetime related column types.

Link copied to clipboard
data class Index(val columns: List<Column<*>>, val unique: Boolean, val customName: String? = null, val indexType: String? = null, val filterCondition: Op<Boolean>? = null, val functions: List<ExpressionWithColumnType<*>>? = null, val functionsTable: Table? = null) : DdlAware

Represents an index.

Link copied to clipboard
class InSubQueryOp<T>(expr: Expression<T>, query: AbstractQuery<*>) : SubQueryOp<T>

Represents an SQL operator that checks if expr is equals to any row returned from query.

Link copied to clipboard

Numeric column for storing 4-byte integers.

Link copied to clipboard

API marked with this annotation is internal and should not be used outside Exposed. It may be changed or removed in the future without notice. Using it outside Exposed may result in undefined and unexpected behaviour.

Link copied to clipboard
class Intersect(firstStatement: AbstractQuery<*>, val secondStatement: AbstractQuery<*>) : SetOperation

Represents an SQL operation that returns only the common rows from two query results, without any duplicates.

Link copied to clipboard
class IsDistinctFromOp(val expression1: Expression<*>, val expression2: Expression<*>) : Op<Boolean> , ComplexExpression, Op.OpBoolean

Represents an SQL operator that checks if expression1 is not equal to expression2, with null treated as a comparable value. This comparison never returns null.

Link copied to clipboard
class IsNotDistinctFromOp(val expression1: Expression<*>, val expression2: Expression<*>) : Op<Boolean> , ComplexExpression, Op.OpBoolean

Represents an SQL operator that checks if expression1 is equal to expression2, with null treated as a comparable value. This comparison never returns null.

Link copied to clipboard

Represents an SQL operator that checks if the specified expr is not null.

Link copied to clipboard

Represents an SQL operator that checks if the specified expr is null.

Link copied to clipboard

Represents all the operators available when building SQL expressions.

Link copied to clipboard
class Join(val table: ColumnSet) : ColumnSet

Represents a join relation between multiple column sets.

Link copied to clipboard

Pair of expressions used to match rows from two joined tables.

Link copied to clipboard

Represents column set join types.

Link copied to clipboard

Marker interface for json/jsonb related column types.

Link copied to clipboard
class Key<T>

Represents a key for a value of type T.

Link copied to clipboard
class Lag<T>(val expr: ExpressionWithColumnType<T>, val offset: ExpressionWithColumnType<Int> = intLiteral(1), val defaultValue: ExpressionWithColumnType<T>? = null) : WindowFunction<T?>

Represents an SQL function that returns value evaluated at the row that is offset rows before the current row within the partition; if there is no such row, instead returns defaultValue.

Link copied to clipboard
open class LargeTextColumnType(val collate: String? = null, val eagerLoading: Boolean = false) : TextColumnType
Link copied to clipboard

Represents an SQL function that returns expr evaluated at the row that is the last row of the window frame.

Link copied to clipboard
class LazySizedCollection<out T>(_delegate: SizedIterable<T>) : SizedIterable<T>

Represents a SizedIterable whose elements are only loaded on first access.

Link copied to clipboard

Represents the iterable elements of a database result, which are stored once loaded on first access.

Link copied to clipboard
class Lead<T>(val expr: ExpressionWithColumnType<T>, val offset: ExpressionWithColumnType<Int> = intLiteral(1), val defaultValue: ExpressionWithColumnType<T>? = null) : WindowFunction<T?>

Represents an SQL function that returns value evaluated at the row that is offset rows after the current row within the partition; if there is no such row, instead returns defaultValue.

Link copied to clipboard
class LessEqOp(val expr1: Expression<*>, val expr2: Expression<*>) : ComparisonOp

Represents an SQL operator that checks if expr1 is less than or equal to expr2.

Link copied to clipboard
class LessOp(val expr1: Expression<*>, val expr2: Expression<*>) : ComparisonOp

Represents an SQL operator that checks if expr1 is less than expr2.

Link copied to clipboard
class LikeEscapeOp(val expr1: Expression<*>, val expr2: Expression<*>, like: Boolean, val escapeChar: Char?) : ComparisonOp

Represents an SQL operator that checks if expr1 matches expr2.

Link copied to clipboard
data class LikePattern(val pattern: String, val escapeChar: Char? = null)

Represents a pattern used for the comparison of string expressions.

Link copied to clipboard
class LiteralOp<T>(val columnType: IColumnType<T & Any>, val value: T) : ExpressionWithColumnType<T>

Represents the specified value as an SQL literal, using the specified columnType to convert the value.

Link copied to clipboard
class Locate<T : String?>(val expr: Expression<T>, val substring: String) : Function<Int>

Represents an SQL function that returns the index of the first occurrence of substring in expr or 0

Link copied to clipboard

Numeric column for storing 8-byte integers.

Link copied to clipboard
class LowerCase<T : String?>(val expr: Expression<T>) : Function<String>

Represents an SQL function that converts expr to lower case.

Link copied to clipboard
class Max<T : Any, in S : T?>(val expr: Expression<in S>, columnType: IColumnType<T>) : Function<T?> , WindowFunction<T?>

Represents an SQL function that returns the maximum value of expr across all non-null input values, or null if there are no non-null values.

Link copied to clipboard
open class MediumTextColumnType(val collate: String? = null, val eagerLoading: Boolean = false) : TextColumnType
Link copied to clipboard
class Min<T : Any, in S : T?>(val expr: Expression<in S>, columnType: IColumnType<T>) : Function<T?> , WindowFunction<T?>

Represents an SQL function that returns the minimum value of expr across all non-null input values, or null if there are no non-null values.

Link copied to clipboard
class MinusOp<T, S : T>(expr1: Expression<T>, expr2: Expression<S>, columnType: IColumnType<T & Any>) : CustomOperator<T>

Represents an SQL operator that subtracts expr2 from expr1.

Link copied to clipboard
class ModOp<T : Number?, S : Number?, R : Number?>(val expr1: Expression<T>, val expr2: Expression<S>, val columnType: IColumnType<R & Any>) : ExpressionWithColumnType<R>

Represents an SQL operator that calculates the remainder of dividing expr1 by expr2.

Link copied to clipboard
class NeqOp(val expr1: Expression<*>, val expr2: Expression<*>) : ComparisonOp

Represents an SQL operator that checks if expr1 is not equals to expr2.

Link copied to clipboard
sealed class NextVal<T> : Function<T>

Represents an SQL function that advances the specified seq and returns the new value.

Link copied to clipboard
class NoOpConversion<T, S>(val expr: Expression<T>, val columnType: IColumnType<S & Any>) : ExpressionWithColumnType<S>

Represents an SQL operator that doesn't perform any operation. This is mainly used to change between column types.

Link copied to clipboard
class NotEqSubQueryOp<T>(expr: Expression<T>, query: AbstractQuery<*>) : SubQueryOp<T>

Represents an SQL operator that checks if expr is not equals to single value returned from query.

Link copied to clipboard
class NotExists(val query: AbstractQuery<*>) : Op<Boolean> , Op.OpBoolean

Represents an SQL operator that checks if query doesn't returns any row.

Link copied to clipboard
class NotInSubQueryOp<T>(expr: Expression<T>, query: AbstractQuery<*>) : SubQueryOp<T>

Represents an SQL operator that checks if expr is not equals to any row returned from query.

Link copied to clipboard
class NotOp<T>(val expr: Expression<T>) : Op<Boolean> , Op.OpBoolean

Represents a logical operator that inverts the specified boolean expr.

Link copied to clipboard

Represents an SQL function that returns expr evaluated at the row that is the n'th row of the window frame (counting from 1); null if no such row

Link copied to clipboard

Returns an integer ranging from 1 to the argument value, dividing the partition as equally as possible.

Link copied to clipboard

A class that handles the transformation between a source column type and a target type, but also supports transformations involving null values.

Link copied to clipboard

Represents offset FOLLOWING window function frame bound.

Link copied to clipboard

Represents offset PRECEDING window function frame bound.

Link copied to clipboard

Represents an offset PRECEDING or FOLLOWING window function frame bound. direction specifies whether previous or next partition rows will be used.

Link copied to clipboard
abstract class Op<T> : Expression<T>

Represents an SQL operator.

Link copied to clipboard
class OrBitOp<T, S : T>(val expr1: Expression<T>, val expr2: Expression<S>, val columnType: IColumnType<T & Any>) : ExpressionWithColumnType<T>

Represents an SQL operator that performs a bitwise or on expr1 and expr2.

Link copied to clipboard
class OrOp(expressions: List<Expression<Boolean>>) : CompoundBooleanOp

Represents a logical operator that performs an or operation between all the specified expressions.

Link copied to clipboard

Represents an SQL function that returns the relative rank of the current row, that is (rank - 1) / (total partition rows - 1). The value thus ranges from 0 to 1 inclusive. scale represents decimal digits count in the fractional part of result.

Link copied to clipboard
class PlusOp<T, S : T>(expr1: Expression<T>, expr2: Expression<S>, columnType: IColumnType<T & Any>) : CustomOperator<T>

Represents an SQL operator that adds expr2 to expr1.

Link copied to clipboard
open class Query(var set: FieldSet, where: Op<Boolean>?) : AbstractQuery<Query>

Class representing an SQL SELECT statement on which query clauses can be built.

Link copied to clipboard
class QueryAlias(val query: AbstractQuery<*>, val alias: String) : ColumnSet

Represents a temporary SQL identifier, alias, for a query.

Link copied to clipboard
class QueryBuilder(val prepared: Boolean)

An object to which SQL expressions and values can be appended.

Link copied to clipboard
class QueryParameter<T>(val value: T, val sqlType: IColumnType<T & Any>) : Expression<T>

Represents the specified value as a query parameter, using the specified sqlType to convert the value.

Link copied to clipboard
class Random(val seed: Int? = null) : Function<BigDecimal>

Represents an SQL function that returns a random value in the range 0.0 <= x < 1.0, using the specified seed.

Link copied to clipboard

Represents an SQL function that returns the rank of the current row, with gaps; that is, the row_number of the first row in its peer group.

Link copied to clipboard

Represents referential actions used by ON UPDATE or ON DELETE subclauses of a FOREIGN KEY constraint clause.

Link copied to clipboard
class RegexpOp<T : String?>(val expr1: Expression<T>, val expr2: Expression<String>, val caseSensitive: Boolean) : Op<Boolean> , ComplexExpression, Op.OpBoolean

Represents an SQL operator that checks if expr1 matches the regular expression expr2.

Link copied to clipboard
class ResultRow(val fieldIndex: Map<Expression<*>, Int>, data: Array<Any?> = arrayOfNulls<Any?>(fieldIndex.size))

A row of data representing a single record retrieved from a database result set.

Link copied to clipboard

Represents an SQL function that returns the number of the current row within its partition, counting from 1.

Link copied to clipboard
data class Schema(name: String, val authorization: String? = null, val password: String? = null, val defaultTablespace: String? = null, val temporaryTablespace: String? = null, val quota: String? = null, val on: String? = null)

Represents a database schema.

Link copied to clipboard

Utility functions that assist with creating, altering, and dropping database schema objects.

Link copied to clipboard
typealias Select = Slice

Represents a subset of fields from a given source.

Link copied to clipboard
class Sequence(val name: String, val startWith: Long? = null, val incrementBy: Long? = null, val minValue: Long? = null, val maxValue: Long? = null, val cycle: Boolean? = null, val cache: Long? = null)

Represents a database sequence.

Link copied to clipboard

Represents an SQL operation that combines the results of multiple queries into a single result.

Link copied to clipboard

Numeric column for storing 2-byte integers.

Link copied to clipboard
class SizedCollection<out T>(val delegate: Collection<T>) : SizedIterable<T>

Represents a SizedIterable that defers to the specified delegate collection.

Link copied to clipboard
interface SizedIterable<out T> : Iterable<T>

Represents the iterable elements of a database result.

Link copied to clipboard

Class representing a provider of log messages at DEBUG level.

Link copied to clipboard
class Slice(val source: ColumnSet, val fields: List<Expression<*>>) : FieldSet

Represents a subset of fields from a given source.

Link copied to clipboard
Link copied to clipboard

Builder object for creating SQL expressions.

Link copied to clipboard
interface SqlLogger

Base class representing a provider of log messages.

Link copied to clipboard
class StdDevPop<T>(val expression: Expression<T>, scale: Int) : Function<BigDecimal?> , WindowFunction<BigDecimal?>

Represents an SQL function that returns the population standard deviation of the non-null input values, or null if there are no non-null values.

Link copied to clipboard
class StdDevSamp<T>(val expression: Expression<T>, scale: Int) : Function<BigDecimal?> , WindowFunction<BigDecimal?>

Represents an SQL function that returns the sample standard deviation of the non-null input values, or null if there are no non-null values.

Link copied to clipboard

Class representing a provider of log messages sent to standard output stream.

Link copied to clipboard
abstract class StringColumnType(val collate: String? = null) : ColumnType<String>

Base character column for storing strings using the specified text collate type.

Link copied to clipboard

Represents an SQL operator that compares expr to any row returned from query.

Link copied to clipboard
class Substring<T : String?>(expr: Expression<T>, start: Expression<Int>, val length: Expression<Int>) : Function<String>

Represents an SQL function that extract a substring from expr that begins at the specified start and with the specified length.

Link copied to clipboard
class Sum<T>(val expr: Expression<T>, columnType: IColumnType<T & Any>) : Function<T?> , WindowFunction<T?>

Represents an SQL function that returns the sum of expr across all non-null input values, or null if there are no non-null values.

Link copied to clipboard
open class Table(name: String = "") : ColumnSet, DdlAware

Base class for any simple table.

Link copied to clipboard
open class TextColumnType(val collate: String? = null, val eagerLoading: Boolean = false) : StringColumnType

Character column for storing strings of arbitrary length using the specified collate type.

Link copied to clipboard
class TimesOp<T, S : T>(expr1: Expression<T>, expr2: Expression<S>, columnType: IColumnType<T & Any>) : CustomOperator<T>

Represents an SQL operator that multiplies expr1 by expr2.

Link copied to clipboard

Class representing a unit block of work that is performed on a database.

Link copied to clipboard
class Trim<T : String?>(val expr: Expression<T>) : Function<String>

Represents an SQL function that remove the longest string containing only spaces from both ends of expr

Link copied to clipboard

Numeric column for storing unsigned 1-byte integers.

Link copied to clipboard

Numeric column for storing unsigned 4-byte integers.

Link copied to clipboard

Numeric column for storing unsigned 8-byte integers.

Link copied to clipboard

Represents UNBOUNDED FOLLOWING window function frame bound.

Link copied to clipboard

Represents UNBOUNDED PRECEDING window function frame bound.

Link copied to clipboard

Represents UNBOUNDED PRECEDING or FOLLOWING window function frame bound. direction specifies whether first or last partition row will be used.

Link copied to clipboard
class Union(firstStatement: AbstractQuery<*>, val secondStatement: AbstractQuery<*>) : SetOperation

Represents an SQL operation that combines all results from two queries, without any duplicates.

Link copied to clipboard
class UnionAll(firstStatement: AbstractQuery<*>, val secondStatement: AbstractQuery<*>) : SetOperation

Represents an SQL operation that combines all results from two queries, with duplicates included.

Link copied to clipboard
class UpperCase<T : String?>(val expr: Expression<T>) : Function<String>

Represents an SQL function that converts expr to upper case.

Link copied to clipboard
open class UserDataHolder

Class for storing transaction data that should remain available to the transaction scope even after the transaction is committed.

Link copied to clipboard

Numeric column for storing unsigned 2-byte integers.

Link copied to clipboard

Binary column for storing UUID.

Link copied to clipboard
open class VarCharColumnType(val colLength: Int = 255, val collate: String? = null) : StringColumnType

Character column for storing strings with the specified maximum colLength using the specified collate type.

Link copied to clipboard
class VarPop<T>(val expression: Expression<T>, scale: Int) : Function<BigDecimal?> , WindowFunction<BigDecimal?>

Represents an SQL function that returns the population variance of the non-null input values (square of the population standard deviation), or null if there are no non-null values.

Link copied to clipboard
class VarSamp<T>(val expression: Expression<T>, scale: Int) : Function<BigDecimal?> , WindowFunction<BigDecimal?>

Represents an SQL function that returns the sample variance of the non-null input values (square of the sample standard deviation), or null if there are no non-null values.

Link copied to clipboard
sealed interface WindowFrameBound

Represents an SQL window function frame start and end bound.

Link copied to clipboard

Represents window function frame bound direction.

Link copied to clipboard

Represents an SQL window function frame clause

Link copied to clipboard

Represents an SQL window function frame unit (also called mode).

Link copied to clipboard
interface WindowFunction<T>

Interface for functions that can be used as window functions.

Link copied to clipboard

Represents an SQL window function with window definition.

Link copied to clipboard
class XorBitOp<T, S : T>(val expr1: Expression<T>, val expr2: Expression<S>, val columnType: IColumnType<T & Any>) : ExpressionWithColumnType<T>

Represents an SQL operator that performs a bitwise or on expr1 and expr2.

Properties

Link copied to clipboard

Returns this column's type cast as AutoIncColumnType or null if the cast fails.

Link copied to clipboard
val exposedLogger: Logger

Returns a org.slf4j.Logger named specifically for Exposed log messages.

Link copied to clipboard

Returns true if this is an auto-increment column, false otherwise.

Link copied to clipboard

Returns the most recent QueryAlias instance used to create this join relation, or null if a query was not joined.

Link copied to clipboard

Returns the name of the database obtained from its connection URL.

Functions

Link copied to clipboard

Adds one or more SqlLoggers to this transaction.

Link copied to clipboard
fun <T : AbstractQuery<*>> T.alias(alias: String): QueryAlias

Creates a temporary identifier, alias, for this query.

fun <T : Table> T.alias(alias: String): Alias<T>

Creates a temporary identifier, alias, for this table.

Creates a temporary identifier, alias, for this expression.

Link copied to clipboard
fun <T> allFrom(subQuery: AbstractQuery<*>): Op<T>

Returns this subquery wrapped in the ALL operator. This function is not supported by the SQLite dialect.

fun <E, T : List<E>?> allFrom(expression: Expression<T>): Op<E>

Returns this expression wrapped in the ALL operator. This function is only supported by PostgreSQL and H2 dialects.

fun <T> allFrom(table: Table): Op<T>

Returns this table wrapped in the ALL operator. This function is only supported by MySQL, PostgreSQL, and H2 dialects.

inline fun <T : Any> allFrom(array: Array<T>, delegateType: ColumnType<T>? = null): Op<T>

Returns this array of data wrapped in the ALL operator. This function is only supported by PostgreSQL and H2 dialects.

inline fun <T : Any> allFrom(array: List<T>, delegateType: ColumnType<T>? = null): Op<T>

Returns this list of data wrapped in the ALL operator. This function is only supported by PostgreSQL and H2 dialects.

Link copied to clipboard

Returns the result of performing a logical and operation between this expression and the op.

Link copied to clipboard

Mutate Query instance and add andPart to having condition with and operator.

Link copied to clipboard

Returns the result of performing a logical and operation between this expression and the op if op is not null. Otherwise, this expression will be returned.

Link copied to clipboard

Returns the result of performing a logical and operation between this expression and the negate op.

Link copied to clipboard

Mutate Query instance and add andPart to where condition with and operator.

Link copied to clipboard
fun <T> anyFrom(subQuery: AbstractQuery<*>): Op<T>

Returns this subquery wrapped in the ANY operator. This function is not supported by the SQLite dialect.

fun <E, T : List<E>?> anyFrom(expression: Expression<T>): Op<E>

Returns this expression wrapped in the ANY operator. This function is only supported by PostgreSQL and H2 dialects.

fun <T> anyFrom(table: Table): Op<T>

Returns this table wrapped in the ANY operator. This function is only supported by MySQL, PostgreSQL, and H2 dialects.

inline fun <T : Any> anyFrom(array: Array<T>, delegateType: ColumnType<T>? = null): Op<T>

Returns this array of data wrapped in the ANY operator. This function is only supported by PostgreSQL and H2 dialects.

inline fun <T : Any> anyFrom(array: List<T>, delegateType: ColumnType<T>? = null): Op<T>

Returns this list of data wrapped in the ANY operator. This function is only supported by PostgreSQL and H2 dialects.

Link copied to clipboard
fun QueryBuilder.append(vararg expr: Any): QueryBuilder

Appends all arguments to this QueryBuilder.

Link copied to clipboard
fun <T> Iterable<T>.appendTo(builder: QueryBuilder, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", transform: QueryBuilder.(T) -> Unit): QueryBuilder

Appends all the elements separated using separator and using the given prefix and postfix if supplied.

Link copied to clipboard
inline fun <T : Any> arrayLiteral(value: List<T>, delegateType: ColumnType<T>? = null): LiteralOp<List<T>>
inline fun <T : Any, R : List<Any>> arrayLiteral(value: R, dimensions: Int, delegateType: ColumnType<T>? = null): LiteralOp<R>

Returns the specified value as an array literal, with elements parsed by the delegateType if provided.

Link copied to clipboard
inline fun <T : Any> arrayParam(value: List<T>, delegateType: ColumnType<T>? = null): Expression<List<T>>
inline fun <T : Any, R : List<Any>> arrayParam(value: R, dimensions: Int, delegateType: ColumnType<T>? = null): Expression<R>

Returns the specified value as an array query parameter, with elements parsed by the delegateType if provided.

Link copied to clipboard
fun <T : Comparable<T>, S : T?> ExpressionWithColumnType<S>.avg(scale: Int = 2): Avg<T, S>

Returns the average (arithmetic mean) value of this expression across all non-null input values, or null if there are no non-null values.

Link copied to clipboard
fun <T : Table, E> T.batchInsert(data: Iterable<E>, ignore: Boolean = false, shouldReturnGeneratedValues: Boolean = true, body: BatchInsertStatement.(E) -> Unit): List<ResultRow>
fun <T : Table, E> T.batchInsert(data: Sequence<E>, ignore: Boolean = false, shouldReturnGeneratedValues: Boolean = true, body: BatchInsertStatement.(E) -> Unit): List<ResultRow>

Represents the SQL statement that batch inserts new rows into a table.

Link copied to clipboard
fun <T : Table, E : Any> T.batchReplace(data: Iterable<E>, shouldReturnGeneratedValues: Boolean = true, body: BatchReplaceStatement.(E) -> Unit): List<ResultRow>
fun <T : Table, E : Any> T.batchReplace(data: Sequence<E>, shouldReturnGeneratedValues: Boolean = true, body: BatchReplaceStatement.(E) -> Unit): List<ResultRow>

Represents the SQL statement that either batch inserts new rows into a table, or, if insertions violate unique constraints, first deletes the existing rows before inserting new rows.

Link copied to clipboard
fun <T : Table, E : Any> T.batchUpsert(data: Iterable<E>, vararg keys: Column<*>, onUpdate: UpsertBuilder.(UpdateStatement) -> Unit? = null, onUpdateExclude: List<Column<*>>? = null, where: SqlExpressionBuilder.() -> Op<Boolean>? = null, shouldReturnGeneratedValues: Boolean = true, body: BatchUpsertStatement.(E) -> Unit): List<ResultRow>
fun <T : Table, E : Any> T.batchUpsert(data: Sequence<E>, vararg keys: Column<*>, onUpdate: UpsertBuilder.(UpdateStatement) -> Unit? = null, onUpdateExclude: List<Column<*>>? = null, where: SqlExpressionBuilder.() -> Op<Boolean>? = null, shouldReturnGeneratedValues: Boolean = true, body: BatchUpsertStatement.(E) -> Unit): List<ResultRow>

Represents the SQL statement that either batch inserts new rows into a table, or updates the existing rows if insertions violate unique constraints.

fun <T : Table, E : Any> T.batchUpsert(data: Iterable<E>, vararg keys: Column<*>, onUpdate: List<Pair<Column<*>, Expression<*>>>, onUpdateExclude: List<Column<*>>? = null, where: SqlExpressionBuilder.() -> Op<Boolean>? = null, shouldReturnGeneratedValues: Boolean = true, body: BatchUpsertStatement.(E) -> Unit): List<ResultRow>
fun <T : Table, E : Any> T.batchUpsert(data: Sequence<E>, vararg keys: Column<*>, onUpdate: List<Pair<Column<*>, Expression<*>>>, onUpdateExclude: List<Column<*>>? = null, where: SqlExpressionBuilder.() -> Op<Boolean>? = null, shouldReturnGeneratedValues: Boolean = true, body: BatchUpsertStatement.(E) -> Unit): List<ResultRow>
Link copied to clipboard
fun blobParam(value: ExposedBlob, useObjectIdentifier: Boolean = false): Expression<ExposedBlob>

Returns the specified value as a blob query parameter.

Link copied to clipboard

Returns the specified value as a boolean literal.

Link copied to clipboard

Returns the specified value as a boolean query parameter.

Link copied to clipboard

Returns the specified value as a byte literal.

Link copied to clipboard

Returns the specified value as a byte query parameter.

Link copied to clipboard

Specifies a conversion from one data type to another.

Link copied to clipboard

Returns the length of this string expression, measured in characters, or null if this expression is null.

Link copied to clipboard
Link copied to clipboard

Reduces this list to a single expression by performing an and operation between all the expressions in the list.

Link copied to clipboard

Reduces this list to a single expression by performing an or operation between all the expressions in the list.

Link copied to clipboard

Returns the number of input rows for which the value of this expression is not null.

Link copied to clipboard

Returns the number of distinct input rows for which the value of this expression is not null.

Link copied to clipboard
fun <C1 : ColumnSet, C2 : ColumnSet> C1.crossJoin(otherTable: C2, onColumn: C1.() -> Expression<*>? = null, otherColumn: C2.() -> Expression<*>? = null, additionalConstraint: SqlExpressionBuilder.() -> Op<Boolean>? = null): Join

Creates a cross join relation with otherTable using onColumn and otherColumn equality and/or additionalConstraint as the join condition.

Link copied to clipboard
fun CustomLongFunction(functionName: String, vararg params: Expression<*>): CustomFunction<Long?>

Calls a custom SQL function with the specified functionName, that returns a long, and passing params as its arguments.

Link copied to clipboard
fun CustomStringFunction(functionName: String, vararg params: Expression<*>): CustomFunction<String?>

Calls a custom SQL function with the specified functionName, that returns a string, and passing params as its arguments.

Link copied to clipboard

Returns the specified value as a decimal literal.

Link copied to clipboard

Returns the specified value as a decimal query parameter.

Link copied to clipboard
fun Join.delete(targetTable: Table, vararg targetTables: Table, ignore: Boolean = false, limit: Int? = null): Int

Represents the SQL statement that deletes all rows from a table in a join relation.

inline fun Join.delete(targetTable: Table, vararg targetTables: Table, ignore: Boolean = false, limit: Int? = null, where: SqlExpressionBuilder.() -> Op<Boolean>): Int

Represents the SQL statement that deletes rows from a table in a join relation.

@JvmName(name = "deleteJoinNullableParam")
fun Join.delete(targetTable: Table, vararg targetTables: Table, ignore: Boolean = false, limit: Int? = null, where: SqlExpressionBuilder.() -> Op<Boolean>? = null): Int
Link copied to clipboard

Represents the SQL statement that deletes all rows in a table.

Link copied to clipboard
inline fun <T : Table> T.deleteIgnoreWhere(limit: Int? = null, op: T.(ISqlExpressionBuilder) -> Op<Boolean>): Int

Represents the SQL statement that deletes only rows in a table that match the provided op, while ignoring any possible errors that occur during the process.

fun <T : Table> T.deleteIgnoreWhere(limit: Int? = null, offset: Long? = null, op: T.(ISqlExpressionBuilder) -> Op<Boolean>): Int
Link copied to clipboard
fun <T : Table> T.deleteReturning(returning: List<Expression<*>> = columns): ReturningStatement

Represents the SQL statement that deletes all rows in a table and returns specified data from the deleted rows.

inline fun <T : Table> T.deleteReturning(returning: List<Expression<*>> = columns, where: SqlExpressionBuilder.() -> Op<Boolean>): ReturningStatement

Represents the SQL statement that deletes rows in a table and returns specified data from the deleted rows.

@JvmName(name = "deleteReturningNullableParam")
fun <T : Table> T.deleteReturning(returning: List<Expression<*>> = columns, where: SqlExpressionBuilder.() -> Op<Boolean>? = null): ReturningStatement
Link copied to clipboard
inline fun <T : Table> T.deleteWhere(limit: Int? = null, op: T.(ISqlExpressionBuilder) -> Op<Boolean>): Int

Represents the SQL statement that deletes only rows in a table that match the provided op.

fun <T : Table> T.deleteWhere(limit: Int? = null, offset: Long? = null, op: T.(ISqlExpressionBuilder) -> Op<Boolean>): Int
Link copied to clipboard

Returns the specified value as a double literal.

Link copied to clipboard

Returns the specified value as a double query parameter.

Link copied to clipboard
Link copied to clipboard

Returns only distinct results from this query that are NOT common to the results of other.

Link copied to clipboard
fun exists(query: AbstractQuery<*>): Exists

Returns an SQL operator that checks if query returns at least one row.

Link copied to clipboard

Returns whether this table exists in the database.

Link copied to clipboard
fun Transaction.explain(analyze: Boolean = false, options: String? = null, body: Transaction.() -> Any?): ExplainQuery

Creates an ExplainQuery using the EXPLAIN keyword, which obtains information about a statement execution plan.

Link copied to clipboard

Returns the specified value as a float literal.

Link copied to clipboard

Returns the specified value as a float query parameter.

Link copied to clipboard
fun <C1 : ColumnSet, C2 : ColumnSet> C1.fullJoin(otherTable: C2, onColumn: C1.() -> Expression<*>? = null, otherColumn: C2.() -> Expression<*>? = null, additionalConstraint: SqlExpressionBuilder.() -> Op<Boolean>? = null): Join

Creates a full outer join relation with otherTable using onColumn and otherColumn equality and/or additionalConstraint as the join condition.

Link copied to clipboard

Calls a custom SQL function with the specified functionName and passes this expression as its only argument.

Link copied to clipboard
infix operator fun <E, T : List<E>?> ExpressionWithColumnType<T>.get(index: Int): ArrayGet<E, T>

Returns the array element stored at the one-based index position, or null if the stored array itself is null.

Link copied to clipboard
fun <T : String?> Expression<T>.groupConcat(separator: String? = null, distinct: Boolean = false, orderBy: Array<Pair<Expression<*>, SortOrder>> = emptyArray()): GroupConcat<T>
fun <T : String?> Expression<T>.groupConcat(separator: String? = null, distinct: Boolean = false, orderBy: Pair<Expression<*>, SortOrder>): GroupConcat<T>

Concatenates all non-null input values of each group from this string expression, separated by separator.

Link copied to clipboard
fun <T : Any> idParam(value: EntityID<T>, column: Column<EntityID<T>>): Expression<EntityID<T>>

Returns the specified value as a query parameter with the same type as column.

Link copied to clipboard
fun <C1 : ColumnSet, C2 : ColumnSet> C1.innerJoin(otherTable: C2, onColumn: C1.() -> Expression<*>? = null, otherColumn: C2.() -> Expression<*>? = null, additionalConstraint: SqlExpressionBuilder.() -> Op<Boolean>? = null): Join

Creates an inner join relation with otherTable using onColumn and otherColumn equality and/or additionalConstraint as the join condition.

Link copied to clipboard
inline fun <T : Table> T.insert(crossinline body: T.(InsertStatement<Number>) -> Unit): InsertStatement<Number>

Represents the SQL statement that inserts a new row into a table.

fun <T : Table> T.insert(selectQuery: AbstractQuery<*>, columns: List<Column<*>> = this.columns.filter { it.isValidIfAutoIncrement() }): Int?

Represents the SQL statement that uses data retrieved from a selectQuery to insert new rows into a table.

Link copied to clipboard
inline fun <Key : Any, T : IdTable<Key>> T.insertAndGetId(crossinline body: T.(InsertStatement<EntityID<Key>>) -> Unit): EntityID<Key>

Represents the SQL statement that inserts a new row into a table.

Link copied to clipboard
inline fun <T : Table> T.insertIgnore(crossinline body: T.(UpdateBuilder<*>) -> Unit): InsertStatement<Long>

Represents the SQL statement that inserts a new row into a table, while ignoring any possible errors that occur during the process.

fun <T : Table> T.insertIgnore(selectQuery: AbstractQuery<*>, columns: List<Column<*>> = this.columns.filter { it.isValidIfAutoIncrement() }): Int?

Represents the SQL statement that uses data retrieved from a selectQuery to insert new rows into a table, while ignoring any possible errors that occur during the process.

Link copied to clipboard
inline fun <Key : Any, T : IdTable<Key>> T.insertIgnoreAndGetId(crossinline body: T.(UpdateBuilder<*>) -> Unit): EntityID<Key>?

Represents the SQL statement that inserts a new row into a table, while ignoring any possible errors that occur during the process.

Link copied to clipboard
inline fun <T : Table> T.insertReturning(returning: List<Expression<*>> = columns, ignoreErrors: Boolean = false, crossinline body: T.(InsertStatement<Number>) -> Unit): ReturningStatement

Represents the SQL statement that inserts new rows into a table and returns specified data from the inserted rows.

Link copied to clipboard

Returns only results from this query that are common to the results of other, WITHOUT including any duplicates.

Link copied to clipboard
fun intLiteral(value: Int): LiteralOp<Int>

Returns the specified value as an int literal.

Link copied to clipboard
fun intParam(value: Int): Expression<Int>

Returns the specified value as an int query parameter.

Link copied to clipboard
fun Join.joinQuery(on: SqlExpressionBuilder.(QueryAlias) -> Op<Boolean>? = null, joinType: JoinType = JoinType.INNER, lateral: Boolean = false, joinPart: () -> AbstractQuery<*>): Join

Creates a join relation with a query.

fun Table.joinQuery(on: SqlExpressionBuilder.(QueryAlias) -> Op<Boolean>? = null, joinType: JoinType = JoinType.INNER, lateral: Boolean = false, joinPart: () -> AbstractQuery<*>): Join

Creates a join relation between this table and a query.

Link copied to clipboard
fun <C1 : ColumnSet, C2 : ColumnSet> C1.leftJoin(otherTable: C2, onColumn: C1.() -> Expression<*>? = null, otherColumn: C2.() -> Expression<*>? = null, additionalConstraint: SqlExpressionBuilder.() -> Op<Boolean>? = null): Join

Creates a left outer join relation with otherTable using onColumn and otherColumn equality and/or additionalConstraint as the join condition.

Link copied to clipboard
fun <T : String?> Expression<T>.locate(substring: String): Locate<T>

Returns the index of the first occurrence of substring in this string expression or 0 if it doesn't contain substring

Link copied to clipboard

Returns the specified value as a long literal.

Link copied to clipboard

Returns the specified value as a long query parameter.

Link copied to clipboard

Converts this string expression to lower case.

Link copied to clipboard
infix fun <T, R> SizedIterable<T>.mapLazy(f: (T) -> R): SizedIterable<R>

Returns a SizedIterable containing the lazily evaluated results of applying the function f to each original element.

Link copied to clipboard
fun <T : Any, S : T?> ExpressionWithColumnType<in S>.max(): Max<T, S>

Returns the maximum value of this expression across all non-null input values, or null if there are no non-null values.

Link copied to clipboard
inline fun <D : Table, S : Table> D.mergeFrom(source: S, crossinline body: MergeTableStatement.() -> Unit): MergeTableStatement
inline fun <D : Table, S : Table> D.mergeFrom(source: S, on: SqlExpressionBuilder.() -> Op<Boolean>, crossinline body: MergeTableStatement.() -> Unit): MergeTableStatement

Performs an SQL MERGE operation to insert, update, or delete records in the target table based on a comparison with a source table.

@JvmName(name = "mergeFromNullableParam")
fun <D : Table, S : Table> D.mergeFrom(source: S, on: SqlExpressionBuilder.() -> Op<Boolean>? = null, body: MergeTableStatement.() -> Unit): MergeTableStatement

inline fun <T : Table> T.mergeFrom(selectQuery: QueryAlias, on: SqlExpressionBuilder.() -> Op<Boolean>, crossinline body: MergeSelectStatement.() -> Unit): MergeSelectStatement

Performs an SQL MERGE operation to insert, update, or delete records in the target table based on a comparison with a select query source.

Link copied to clipboard
fun <T : Any, S : T?> ExpressionWithColumnType<in S>.min(): Min<T, S>

Returns the minimum value of this expression across all non-null input values, or null if there are no non-null values.

Link copied to clipboard

Advances this sequence and returns the new value.

Link copied to clipboard

Advances this sequence and returns the new value.

Link copied to clipboard

Returns the inverse of this boolean expression.

Link copied to clipboard

Returns an SQL operator that checks if query doesn't returns any row.

Link copied to clipboard

Returns the result of performing a logical or operation between this expression and the op.

Link copied to clipboard

Mutate Query instance and add orPart to having condition with or operator.

Link copied to clipboard

Returns the result of performing a logical or operation between this expression and the op if op is not null. Otherwise, this expression will be returned.

Link copied to clipboard

Returns the result of performing a logical or operation between this expression and the negate op.

Link copied to clipboard

Mutate Query instance and add orPart to where condition with or operator.

Link copied to clipboard
inline fun <T : Table> T.replace(crossinline body: T.(UpdateBuilder<*>) -> Unit): ReplaceStatement<Long>

Represents the SQL statement that either inserts a new row into a table, or, if insertion would violate a unique constraint, first deletes the existing row before inserting a new row.

fun <T : Table> T.replace(selectQuery: AbstractQuery<*>, columns: List<Column<*>> = this.columns.filter { it.isValidIfAutoIncrement() }): Int?

Represents the SQL statement that uses data retrieved from a selectQuery to either insert a new row into a table, or, if insertion would violate a unique constraint, first delete the existing row before inserting a new row.

Link copied to clipboard
fun <T : Any> resolveColumnType(klass: KClass<T>, defaultType: ColumnType<*>? = null): ColumnType<T>

Returns the ColumnType commonly associated with storing values of type T, or the defaultType if a mapping does not exist for type T.

Link copied to clipboard
fun <C1 : ColumnSet, C2 : ColumnSet> C1.rightJoin(otherTable: C2, onColumn: C1.() -> Expression<*>? = null, otherColumn: C2.() -> Expression<*>? = null, additionalConstraint: SqlExpressionBuilder.() -> Op<Boolean>? = null): Join

Creates a right outer join relation with otherTable using onColumn and otherColumn equality and/or additionalConstraint as the join condition.

Link copied to clipboard
inline fun FieldSet.select(where: SqlExpressionBuilder.() -> Op<Boolean>): Query
inline fun Query.select(where: SqlExpressionBuilder.() -> Op<Boolean>): Query
fun Query.select(where: Op<Boolean>): Query
Link copied to clipboard

Creates a SELECT Query by selecting all columns from this ColumnSet.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the specified value as a short literal.

Link copied to clipboard

Returns the specified value as a short query parameter.

Link copied to clipboard
fun <E, T : List<E>?> ExpressionWithColumnType<T>.slice(lower: Int? = null, upper: Int? = null): ArraySlice<E, T>

Returns a subarray of elements stored from between lower and upper bounds (inclusive), or null if the stored array itself is null. Note If either bounds is left null, the database will use the stored array's respective lower or upper limit.

Link copied to clipboard

Returns the population standard deviation of the non-null input values, or null if there are no non-null values.

Link copied to clipboard

Returns the sample standard deviation of the non-null input values, or null if there are no non-null values.

Link copied to clipboard

Returns the specified value as a string literal.

Link copied to clipboard

Returns the specified value as a string query parameter.

Link copied to clipboard
fun <T : String?> Expression<T>.substring(start: Int, length: Int): Substring<T>

Extract a substring from this string expression that begins at the specified start and with the specified length.

Link copied to clipboard

Returns the sum of this expression across all non-null input values, or null if there are no non-null values.

Link copied to clipboard

Returns the list of tables to which the columns in this column set belong.

Link copied to clipboard
fun <T : String?> Expression<T>.trim(): Trim<T>

Removes the longest string containing only spaces from both ends of string expression.

Link copied to clipboard

Returns the specified value as a unsigned byte literal.

Link copied to clipboard

Returns the specified value as a unsigned byte query parameter.

Link copied to clipboard

Returns the specified value as a unsigned int literal.

Link copied to clipboard

Returns the specified value as a unsigned int query parameter.

Link copied to clipboard

Returns the specified value as a unsigned long literal.

Link copied to clipboard

Returns the specified value as a unsigned long query parameter.

Link copied to clipboard
fun AbstractQuery<*>.union(other: Query): Union

Combines all results from this query with the results of other, WITHOUT including duplicates.

Link copied to clipboard

Combines all results from this query with the results of other, WITH duplicates included.

Link copied to clipboard
inline fun <T : Table> T.update(limit: Int? = null, crossinline body: T.(UpdateStatement) -> Unit): Int

Represents the SQL statement that updates all rows of a table.

inline fun Join.update(limit: Int? = null, crossinline body: (UpdateStatement) -> Unit): Int

Represents the SQL statement that updates all rows of a join relation.

inline fun <T : Table> T.update(where: SqlExpressionBuilder.() -> Op<Boolean>, limit: Int? = null, crossinline body: T.(UpdateStatement) -> Unit): Int

Represents the SQL statement that updates rows of a table.

@JvmName(name = "updateNullableParam")
fun <T : Table> T.update(where: SqlExpressionBuilder.() -> Op<Boolean>? = null, limit: Int? = null, body: T.(UpdateStatement) -> Unit): Int
@JvmName(name = "updateJoinNullableParam")
fun Join.update(where: SqlExpressionBuilder.() -> Op<Boolean>? = null, limit: Int? = null, body: (UpdateStatement) -> Unit): Int

inline fun Join.update(where: SqlExpressionBuilder.() -> Op<Boolean>, limit: Int? = null, crossinline body: (UpdateStatement) -> Unit): Int

Represents the SQL statement that updates rows of a join relation.

Link copied to clipboard
inline fun <T : Table> T.updateReturning(returning: List<Expression<*>> = columns, crossinline body: T.(UpdateStatement) -> Unit): ReturningStatement

Represents the SQL statement that updates all rows of a table and returns specified data from the updated rows.

inline fun <T : Table> T.updateReturning(returning: List<Expression<*>> = columns, where: SqlExpressionBuilder.() -> Op<Boolean>, crossinline body: T.(UpdateStatement) -> Unit): ReturningStatement

Represents the SQL statement that updates rows of a table and returns specified data from the updated rows.

@JvmName(name = "updateReturningNullableParam")
fun <T : Table> T.updateReturning(returning: List<Expression<*>> = columns, where: SqlExpressionBuilder.() -> Op<Boolean>? = null, body: T.(UpdateStatement) -> Unit): ReturningStatement
Link copied to clipboard

Converts this string expression to upper case.

Link copied to clipboard
fun <T : Table> T.upsert(vararg keys: Column<*>, onUpdate: UpsertBuilder.(UpdateStatement) -> Unit? = null, onUpdateExclude: List<Column<*>>? = null, where: SqlExpressionBuilder.() -> Op<Boolean>? = null, body: T.(UpsertStatement<Long>) -> Unit): UpsertStatement<Long>

Represents the SQL statement that either inserts a new row into a table, or updates the existing row if insertion would violate a unique constraint.

fun <T : Table> T.upsert(vararg keys: Column<*>, onUpdate: List<Pair<Column<*>, Expression<*>>>, onUpdateExclude: List<Column<*>>? = null, where: SqlExpressionBuilder.() -> Op<Boolean>? = null, body: T.(UpsertStatement<Long>) -> Unit): UpsertStatement<Long>
Link copied to clipboard
fun <T : Table> T.upsertReturning(vararg keys: Column<*>, returning: List<Expression<*>> = columns, onUpdate: UpsertBuilder.(UpdateStatement) -> Unit? = null, onUpdateExclude: List<Column<*>>? = null, where: SqlExpressionBuilder.() -> Op<Boolean>? = null, body: T.(UpsertStatement<Long>) -> Unit): ReturningStatement

Represents the SQL statement that either inserts a new row into a table, or updates the existing row if insertion would violate a unique constraint, and also returns specified data from the modified rows.

fun <T : Table> T.upsertReturning(vararg keys: Column<*>, returning: List<Expression<*>> = columns, onUpdate: List<Pair<Column<*>, Expression<*>>>, onUpdateExclude: List<Column<*>>? = null, where: SqlExpressionBuilder.() -> Op<Boolean>? = null, body: T.(UpsertStatement<Long>) -> Unit): ReturningStatement
Link copied to clipboard

Returns the specified value as a unsigned short literal.

Link copied to clipboard

Returns the specified value as a unsigned short query parameter.

Link copied to clipboard

Returns the population variance of the non-null input values (square of the population standard deviation), or null if there are no non-null values.

Link copied to clipboard

Returns the sample variance of the non-null input values (square of the sample standard deviation), or null if there are no non-null values.

Link copied to clipboard

Wraps a query as an Expression so that it can be used as part of an SQL statement or in another query clause.