# Package-level declarations

## Types

AbstractQuery
Link copied to clipboard
abstract class AbstractQuery<T : AbstractQuery<T>>(targets: List<Table>) : Statement<ResultSet> , SizedIterable<ResultRow>

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

Alias
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.

AndBitOp
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.

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

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

ArrayColumnType
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.

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

Auto-increment column type.

Avg
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.

BasicBinaryColumnType
Link copied to clipboard
open class BasicBinaryColumnType : ColumnType<ByteArray>

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

Between
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.

BiCompositeColumn
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.

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

Binary column for storing binary strings of a specific length.

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

Binary column for storing BLOBs.

BooleanColumnType
Link copied to clipboard
class BooleanColumnType : ColumnType<Boolean>

Boolean column for storing boolean values.

ByteColumnType
Link copied to clipboard
class ByteColumnType : ColumnType<Byte>

Numeric column for storing 1-byte integers.

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

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

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

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

CaseWhenElse
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`.

Cast
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.

CharacterColumnType
Link copied to clipboard
class CharacterColumnType : ColumnType<Char>

Character column for storing single characters.

CharColumnType
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.

CharLength
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.

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

Represents a check constraint.

Coalesce
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.

Column
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.

ColumnDiff
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.

ColumnSet
Link copied to clipboard
abstract class ColumnSet : FieldSet

Represents a set of columns.

ColumnTransformer
Link copied to clipboard
interface ColumnTransformer<Unwrapped, Wrapped>

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

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

Standard column type.

ColumnWithTransform
Link copied to clipboard
open class ColumnWithTransform<Unwrapped, Wrapped>(val delegate: IColumnType<Unwrapped & Any>, val transformer: ColumnTransformer<Unwrapped, Wrapped>) : ColumnType<Wrapped & Any>

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

ComparisonOp
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.

ComplexExpression
Link copied to clipboard
interface ComplexExpression

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

CompositeColumn
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

CompositeSqlLogger
Link copied to clipboard
class CompositeSqlLogger : SqlLogger, StatementInterceptor

Class representing one or more SqlLoggers.

CompoundBooleanOp
Link copied to clipboard
sealed class CompoundBooleanOp : Op<Boolean> , ComplexExpression, Op.OpBoolean

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

Concat
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.

Count
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.

CumeDist
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.

CurrentOrFollowing
Link copied to clipboard
interface CurrentOrFollowing : WindowFrameBound

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

CurrentOrPreceding
Link copied to clipboard
interface CurrentOrPreceding : WindowFrameBound

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

CurrentRowWindowFrameBound
Link copied to clipboard
object CurrentRowWindowFrameBound : WindowFrameBound, CurrentOrPreceding, CurrentOrFollowing

Represents an CURRENT ROW window function frame bound.

CustomEnumerationColumnType
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.

CustomFunction
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.

CustomOperator
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.

Database
Link copied to clipboard
class Database

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

DatabaseConfig
Link copied to clipboard
class DatabaseConfig

A configuration class for a Database.

DatabaseConnectionAutoRegistration
Link copied to clipboard
interface DatabaseConnectionAutoRegistration : Function1<Connection, ExposedConnection<*>>

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

DdlAware
Link copied to clipboard
interface DdlAware

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

DecimalColumnType
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.

DenseRank
Link copied to clipboard
class DenseRank : WindowFunction<Long>

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

DivideOp
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.

DoubleColumnType
Link copied to clipboard
class DoubleColumnType : ColumnType<Double>

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

EmptySizedIterable
Link copied to clipboard
class EmptySizedIterable<out T> : SizedIterable<T> , Iterator<T>

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

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

Identity column type for storing unique EntityID values.

EnumerationColumnType
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.

EnumerationNameColumnType
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.

EqOp
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.

EqSubQueryOp
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.

Except
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.

Exists
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.

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

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

ExperimentalKeywordApi
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.

ExplainQuery
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.

ExplainResultRow
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.

Expression
Link copied to clipboard
abstract class Expression<T>

Represents an SQL expression of type T.

ExpressionAlias
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.

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

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

FieldSet
Link copied to clipboard
interface FieldSet

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

FilterCondition
Link copied to clipboard
typealias FilterCondition = SqlExpressionBuilder.() -> Op<Boolean>?

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

FirstValue
Link copied to clipboard
class FirstValue<T>(val expr: ExpressionWithColumnType<T>) : WindowFunction<T>

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

FloatColumnType
Link copied to clipboard
class FloatColumnType : ColumnType<Float>

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

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

Represents a foreign key constraint.

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

Represents an SQL function.

GreaterEqOp
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.

GreaterOp
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.

GroupConcat
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

IColumnType
Link copied to clipboard
interface IColumnType<T>

Interface common to all column types.

IDateColumnType
Link copied to clipboard
interface IDateColumnType

Marker interface for date/datetime related column types.

Index
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.

InSubQueryOp
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.

IntegerColumnType
Link copied to clipboard
class IntegerColumnType : ColumnType<Int>

Numeric column for storing 4-byte integers.

InternalApi
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPEALIAS])
annotation class InternalApi

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.

Intersect
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.

IsDistinctFromOp
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.

IsNotDistinctFromOp
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.

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

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

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

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

ISqlExpressionBuilder
Link copied to clipboard
interface ISqlExpressionBuilder

Represents all the operators available when building SQL expressions.

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

Represents a join relation between multiple column sets.

JoinCondition
Link copied to clipboard
typealias JoinCondition = Pair<Expression<*>, Expression<*>>

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

JoinType
Link copied to clipboard
enum JoinType : Enum<JoinType>

Represents column set join types.

JsonColumnMarker
Link copied to clipboard
interface JsonColumnMarker

Marker interface for json/jsonb related column types.

Key
Link copied to clipboard
class Key<T>

Represents a key for a value of type T.

Lag
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.

LargeTextColumnType
Link copied to clipboard
open class LargeTextColumnType(val collate: String? = null, val eagerLoading: Boolean = false) : TextColumnType
LastValue
Link copied to clipboard
class LastValue<T>(val expr: ExpressionWithColumnType<T>) : WindowFunction<T>

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

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

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

LazySizedIterable
Link copied to clipboard
interface LazySizedIterable<T> : SizedIterable<T>

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

Lead
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.

LessEqOp
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.

LessOp
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.

LikeEscapeOp
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.

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

Represents a pattern used for the comparison of string expressions.

LiteralOp
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.

Locate
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

LongColumnType
Link copied to clipboard
class LongColumnType : ColumnType<Long>

Numeric column for storing 8-byte integers.

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

Represents an SQL function that converts expr to lower case.

Max
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.

MediumTextColumnType
Link copied to clipboard
open class MediumTextColumnType(val collate: String? = null, val eagerLoading: Boolean = false) : TextColumnType
Min
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.

MinusOp
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.

ModOp
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.

NeqOp
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.

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

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

NoOpConversion
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.

NotEqSubQueryOp
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.

NotExists
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.

NotInSubQueryOp
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.

NotOp
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.

NthValue
Link copied to clipboard
class NthValue<T>(val expr: ExpressionWithColumnType<T>, val n: ExpressionWithColumnType<Int>) : WindowFunction<T?>

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

Ntile
Link copied to clipboard
class Ntile(val numBuckets: ExpressionWithColumnType<Int>) : WindowFunction<Int>

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

NullableColumnWithTransform
Link copied to clipboard
open class NullableColumnWithTransform<Unwrapped, Wrapped>(delegate: IColumnType<Unwrapped & Any>, transformer: ColumnTransformer<Unwrapped, Wrapped>) : ColumnWithTransform<Unwrapped, Wrapped>

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

OffsetFollowingWindowFrameBound
Link copied to clipboard
class OffsetFollowingWindowFrameBound(offset: Expression<Int>) : OffsetWindowFrameBound, CurrentOrFollowing

Represents offset FOLLOWING window function frame bound.

OffsetPrecedingWindowFrameBound
Link copied to clipboard
class OffsetPrecedingWindowFrameBound(offset: Expression<Int>) : OffsetWindowFrameBound, CurrentOrPreceding

Represents offset PRECEDING window function frame bound.

OffsetWindowFrameBound
Link copied to clipboard
open class OffsetWindowFrameBound(offset: Expression<Int>, direction: WindowFrameBoundDirection) : WindowFrameBound

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

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

Represents an SQL operator.

OrBitOp
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.

OrOp
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.

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

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.

PlusOp
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.

Query
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.

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

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

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

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

QueryParameter
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.

Random
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.

Rank
Link copied to clipboard
class Rank : WindowFunction<Long>

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.

ReferenceOption
Link copied to clipboard
enum ReferenceOption : Enum<ReferenceOption>

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

RegexpOp
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.

ResultRow
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.

RowNumber
Link copied to clipboard
class RowNumber : WindowFunction<Long>

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

Schema
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.

SchemaUtils
Link copied to clipboard
object SchemaUtils

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

Select
Link copied to clipboard
typealias Select = Slice

Represents a subset of fields from a given source.

Sequence
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.

SetOperation
Link copied to clipboard
sealed class SetOperation : AbstractQuery<SetOperation>

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

ShortColumnType
Link copied to clipboard
class ShortColumnType : ColumnType<Short>

Numeric column for storing 2-byte integers.

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

Represents a SizedIterable that defers to the specified delegate collection.

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

Represents the iterable elements of a database result.

Slf4jSqlDebugLogger
Link copied to clipboard
object Slf4jSqlDebugLogger : SqlLogger

Class representing a provider of log messages at DEBUG level.

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

Represents a subset of fields from a given source.

SortOrder
Link copied to clipboard
enum SortOrder : Enum<SortOrder>
SqlExpressionBuilder
Link copied to clipboard
object SqlExpressionBuilder : ISqlExpressionBuilder

Builder object for creating SQL expressions.

SqlLogger
Link copied to clipboard
interface SqlLogger

Base class representing a provider of log messages.

StdDevPop
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.

StdDevSamp
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.

StdOutSqlLogger
Link copied to clipboard
object StdOutSqlLogger : SqlLogger

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

StringColumnType
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.

SubQueryOp
Link copied to clipboard
sealed class SubQueryOp<T> : Op<Boolean> , ComplexExpression, Op.OpBoolean

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

Substring
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.

Sum
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.

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

Base class for any simple table.

TextColumnType
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.

TimesOp
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.

Transaction
Link copied to clipboard
open class Transaction(transactionImpl: TransactionInterface) : UserDataHolder, TransactionInterface

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

Trim
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

UByteColumnType
Link copied to clipboard
class UByteColumnType : ColumnType<UByte>

Numeric column for storing unsigned 1-byte integers.

UIntegerColumnType
Link copied to clipboard
class UIntegerColumnType : ColumnType<UInt>

Numeric column for storing unsigned 4-byte integers.

ULongColumnType
Link copied to clipboard
class ULongColumnType : ColumnType<ULong>

Numeric column for storing unsigned 8-byte integers.

UnboundedFollowingWindowFrameBound
Link copied to clipboard
class UnboundedFollowingWindowFrameBound : UnboundedWindowFrameBound, CurrentOrFollowing

Represents UNBOUNDED FOLLOWING window function frame bound.

UnboundedPrecedingWindowFrameBound
Link copied to clipboard
class UnboundedPrecedingWindowFrameBound : UnboundedWindowFrameBound, CurrentOrPreceding

Represents UNBOUNDED PRECEDING window function frame bound.

UnboundedWindowFrameBound
Link copied to clipboard
open class UnboundedWindowFrameBound(direction: WindowFrameBoundDirection) : WindowFrameBound

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

Union
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.

UnionAll
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.

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

Represents an SQL function that converts expr to upper case.

UserDataHolder
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.

UShortColumnType
Link copied to clipboard
class UShortColumnType : ColumnType<UShort>

Numeric column for storing unsigned 2-byte integers.

UUIDColumnType
Link copied to clipboard
class UUIDColumnType : ColumnType<UUID>

Binary column for storing UUID.

VarCharColumnType
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.

VarPop
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.

VarSamp
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.

WindowFrameBound
Link copied to clipboard
sealed interface WindowFrameBound

Represents an SQL window function frame start and end bound.

WindowFrameBoundDirection
Link copied to clipboard
enum WindowFrameBoundDirection : Enum<WindowFrameBoundDirection>

Represents window function frame bound direction.

WindowFrameClause
Link copied to clipboard
class WindowFrameClause(unit: WindowFrameUnit, start: WindowFrameBound, end: WindowFrameBound? = null)

Represents an SQL window function frame clause

WindowFrameUnit
Link copied to clipboard
enum WindowFrameUnit : Enum<WindowFrameUnit>

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

WindowFunction
Link copied to clipboard
interface WindowFunction<T>

Interface for functions that can be used as window functions.

WindowFunctionDefinition
Link copied to clipboard
class WindowFunctionDefinition<T>(val columnType: IColumnType<T & Any>, function: WindowFunction<T>) : ExpressionWithColumnType<T>

Represents an SQL window function with window definition.

XorBitOp
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

autoIncColumnType
Link copied to clipboard
val Column<*>.autoIncColumnType: AutoIncColumnType<*>?

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

exposedLogger
Link copied to clipboard
val exposedLogger: Logger

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

isAutoInc
Link copied to clipboard
val IColumnType<*>.isAutoInc: Boolean

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

lastQueryAlias
Link copied to clipboard
val Join.lastQueryAlias: QueryAlias?

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

name
Link copied to clipboard
val Database.name: String

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

## Functions

addLogger
Link copied to clipboard
fun Transaction.addLogger(vararg logger: SqlLogger): CompositeSqlLogger

Adds one or more SqlLoggers to this transaction.

alias
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.

fun <T> Expression<T>.alias(alias: String): ExpressionAlias<T>

Creates a temporary identifier, alias, for this expression.

allFrom
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.

and
Link copied to clipboard
inline fun Expression<Boolean>.and(op: SqlExpressionBuilder.() -> Op<Boolean>): Op<Boolean>
infix fun Expression<Boolean>.and(op: Expression<Boolean>): Op<Boolean>

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

andHaving
Link copied to clipboard
fun Query.andHaving(andPart: SqlExpressionBuilder.() -> Op<Boolean>): Query

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

andIfNotNull
Link copied to clipboard
inline fun Op<Boolean>.andIfNotNull(op: SqlExpressionBuilder.() -> Op<Boolean>?): Op<Boolean>
infix fun Op<Boolean>.andIfNotNull(op: Expression<Boolean>?): Op<Boolean>

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.

andNot
Link copied to clipboard
inline fun Expression<Boolean>.andNot(op: SqlExpressionBuilder.() -> Op<Boolean>): Op<Boolean>

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

andWhere
Link copied to clipboard
fun Query.andWhere(andPart: SqlExpressionBuilder.() -> Op<Boolean>): Query

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

anyFrom
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.

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

Appends all arguments to this QueryBuilder.

appendTo
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.

arrayLiteral
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.

arrayParam
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.

avg
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.

batchInsert
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.

batchReplace
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.

batchUpsert
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>
blobParam
Link copied to clipboard
fun blobParam(value: ExposedBlob, useObjectIdentifier: Boolean = false): Expression<ExposedBlob>

Returns the specified value as a blob query parameter.

booleanLiteral
Link copied to clipboard
fun booleanLiteral(value: Boolean): LiteralOp<Boolean>

Returns the specified value as a boolean literal.

booleanParam
Link copied to clipboard
fun booleanParam(value: Boolean): Expression<Boolean>

Returns the specified value as a boolean query parameter.

byteLiteral
Link copied to clipboard
fun byteLiteral(value: Byte): LiteralOp<Byte>

Returns the specified value as a byte literal.

byteParam
Link copied to clipboard
fun byteParam(value: Byte): Expression<Byte>

Returns the specified value as a byte query parameter.

castTo
Link copied to clipboard
fun <R> Expression<*>.castTo(columnType: IColumnType<R & Any>): ExpressionWithColumnType<R>

Specifies a conversion from one data type to another.

charLength
Link copied to clipboard
fun <T : String?> Expression<T>.charLength(): CharLength<T>

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

columnTransformer
Link copied to clipboard
fun <Unwrapped, Wrapped> columnTransformer(unwrap: (value: Wrapped) -> Unwrapped, wrap: (value: Unwrapped) -> Wrapped): ColumnTransformer<Unwrapped, Wrapped>
compoundAnd
Link copied to clipboard
fun List<Op<Boolean>>.compoundAnd(): Op<Boolean>

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

compoundOr
Link copied to clipboard
fun List<Op<Boolean>>.compoundOr(): Op<Boolean>

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

count
Link copied to clipboard
fun ExpressionWithColumnType<*>.count(): Count

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

countDistinct
Link copied to clipboard
fun Column<*>.countDistinct(): Count

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

crossJoin
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.

CustomLongFunction
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.

CustomStringFunction
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.

decimalLiteral
Link copied to clipboard
fun decimalLiteral(value: BigDecimal): LiteralOp<BigDecimal>

Returns the specified value as a decimal literal.

decimalParam
Link copied to clipboard
fun decimalParam(value: BigDecimal): Expression<BigDecimal>

Returns the specified value as a decimal query parameter.

delete
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
deleteAll
Link copied to clipboard
fun Table.deleteAll(): Int

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

deleteIgnoreWhere
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
deleteReturning
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
deleteWhere
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
doubleLiteral
Link copied to clipboard
fun doubleLiteral(value: Double): LiteralOp<Double>

Returns the specified value as a double literal.

doubleParam
Link copied to clipboard
fun doubleParam(value: Double): Expression<Double>

Returns the specified value as a double query parameter.

emptySized
Link copied to clipboard
fun <T> emptySized(): SizedIterable<T>

Returns an EmptySizedIterable.

except
Link copied to clipboard
fun AbstractQuery<*>.except(other: Query): Except

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

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

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

exists
Link copied to clipboard
fun Table.exists(): Boolean

Returns whether this table exists in the database.

explain
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.

floatLiteral
Link copied to clipboard
fun floatLiteral(value: Float): LiteralOp<Float>

Returns the specified value as a float literal.

floatParam
Link copied to clipboard
fun floatParam(value: Float): Expression<Float>

Returns the specified value as a float query parameter.

fullJoin
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.

function
Link copied to clipboard
fun <T> ExpressionWithColumnType<T>.function(functionName: String): CustomFunction<T?>

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

get
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.

groupConcat
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.

idParam
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.

innerJoin
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.

insert
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.

insertAndGetId
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.

insertIgnore
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.

insertIgnoreAndGetId
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.

insertReturning
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.

intersect
Link copied to clipboard
fun AbstractQuery<*>.intersect(other: Query): Intersect

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

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

Returns the specified value as an int literal.

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

Returns the specified value as an int query parameter.

joinQuery
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.

leftJoin
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.

locate
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

longLiteral
Link copied to clipboard
fun longLiteral(value: Long): LiteralOp<Long>

Returns the specified value as a long literal.

longParam
Link copied to clipboard
fun longParam(value: Long): Expression<Long>

Returns the specified value as a long query parameter.

lowerCase
Link copied to clipboard
fun <T : String?> Expression<T>.lowerCase(): LowerCase<T>

Converts this string expression to lower case.

mapLazy
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.

max
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.

mergeFrom
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.

min
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.

nextIntVal
Link copied to clipboard
fun Sequence.nextIntVal(): NextVal<Int>

Advances this sequence and returns the new value.

nextLongVal
Link copied to clipboard
fun Sequence.nextLongVal(): NextVal<Long>

Advances this sequence and returns the new value.

not
Link copied to clipboard
fun not(op: Expression<Boolean>): Op<Boolean>

Returns the inverse of this boolean expression.

notExists
Link copied to clipboard
fun notExists(query: AbstractQuery<*>): NotExists

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

or
Link copied to clipboard
inline fun Expression<Boolean>.or(op: SqlExpressionBuilder.() -> Op<Boolean>): Op<Boolean>
infix fun Expression<Boolean>.or(op: Expression<Boolean>): Op<Boolean>

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

orHaving
Link copied to clipboard
fun Query.orHaving(orPart: SqlExpressionBuilder.() -> Op<Boolean>): Query

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

orIfNotNull
Link copied to clipboard
inline fun Op<Boolean>.orIfNotNull(op: SqlExpressionBuilder.() -> Op<Boolean>?): Op<Boolean>
infix fun Op<Boolean>.orIfNotNull(op: Expression<Boolean>?): Op<Boolean>

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.

orNot
Link copied to clipboard
inline fun Expression<Boolean>.orNot(op: SqlExpressionBuilder.() -> Op<Boolean>): Op<Boolean>

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

orWhere
Link copied to clipboard
fun Query.orWhere(orPart: SqlExpressionBuilder.() -> Op<Boolean>): Query

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

replace
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.

resolveColumnType
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.

rightJoin
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.

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

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

selectAllBatched
Link copied to clipboard
fun FieldSet.selectAllBatched(batchSize: Int = 1000): Iterable<Iterable<ResultRow>>
fun Query.selectAllBatched(batchSize: Int = 1000): Iterable<Iterable<ResultRow>>
selectBatched
Link copied to clipboard
fun FieldSet.selectBatched(batchSize: Int = 1000, where: SqlExpressionBuilder.() -> Op<Boolean>): Iterable<Iterable<ResultRow>>
fun Query.selectBatched(batchSize: Int = 1000, where: SqlExpressionBuilder.() -> Op<Boolean>): Iterable<Iterable<ResultRow>>
shortLiteral
Link copied to clipboard
fun shortLiteral(value: Short): LiteralOp<Short>

Returns the specified value as a short literal.

shortParam
Link copied to clipboard
fun shortParam(value: Short): Expression<Short>

Returns the specified value as a short query parameter.

slice
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.

stdDevPop
Link copied to clipboard
fun <T> ExpressionWithColumnType<T>.stdDevPop(scale: Int = 2): StdDevPop<T>

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

stdDevSamp
Link copied to clipboard
fun <T> ExpressionWithColumnType<T>.stdDevSamp(scale: Int = 2): StdDevSamp<T>

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

stringLiteral
Link copied to clipboard
fun stringLiteral(value: String): LiteralOp<String>

Returns the specified value as a string literal.

stringParam
Link copied to clipboard
fun stringParam(value: String): Expression<String>

Returns the specified value as a string query parameter.

substring
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.

sum
Link copied to clipboard
fun <T> ExpressionWithColumnType<T>.sum(): Sum<T>

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

targetTables
Link copied to clipboard
fun ColumnSet.targetTables(): List<Table>

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

trim
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.

ubyteLiteral
Link copied to clipboard
fun ubyteLiteral(value: UByte): LiteralOp<UByte>

Returns the specified value as a unsigned byte literal.

ubyteParam
Link copied to clipboard
fun ubyteParam(value: UByte): Expression<UByte>

Returns the specified value as a unsigned byte query parameter.

uintLiteral
Link copied to clipboard
fun uintLiteral(value: UInt): LiteralOp<UInt>

Returns the specified value as a unsigned int literal.

uintParam
Link copied to clipboard
fun uintParam(value: UInt): Expression<UInt>

Returns the specified value as a unsigned int query parameter.

ulongLiteral
Link copied to clipboard
fun ulongLiteral(value: ULong): LiteralOp<ULong>

Returns the specified value as a unsigned long literal.

ulongParam
Link copied to clipboard
fun ulongParam(value: ULong): Expression<ULong>

Returns the specified value as a unsigned long query parameter.

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

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

unionAll
Link copied to clipboard
fun AbstractQuery<*>.unionAll(other: Query): UnionAll

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

update
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.

updateReturning
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
upperCase
Link copied to clipboard
fun <T : String?> Expression<T>.upperCase(): UpperCase<T>

Converts this string expression to upper case.

upsert
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>
upsertReturning
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
ushortLiteral
Link copied to clipboard
fun ushortLiteral(value: UShort): LiteralOp<UShort>

Returns the specified value as a unsigned short literal.

ushortParam
Link copied to clipboard
fun ushortParam(value: UShort): Expression<UShort>

Returns the specified value as a unsigned short query parameter.

varPop
Link copied to clipboard
fun <T> ExpressionWithColumnType<T>.varPop(scale: Int = 2): VarPop<T>

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.

varSamp
Link copied to clipboard
fun <T> ExpressionWithColumnType<T>.varSamp(scale: Int = 2): VarSamp<T>

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.

wrapAsExpression
Link copied to clipboard
fun <T : Any> wrapAsExpression(query: AbstractQuery<*>): Expression<T?>

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