Package-level declarations

Types

Link copied to clipboard

SqlType implementation represents PostgreSQL boolean[] type.

Link copied to clipboard
data class BulkInsertExpression(val table: TableExpression, val assignments: List<List<ColumnAssignmentExpression<*>>>, val conflictColumns: List<ColumnExpression<*>> = emptyList(), val updateAssignments: List<ColumnAssignmentExpression<*>> = emptyList(), val returningColumns: List<ColumnExpression<*>> = emptyList(), val isLeafNode: Boolean = false, val extraProperties: Map<String, Any> = emptyMap()) : SqlExpression

Bulk insert expression, represents a bulk insert statement in PostgreSQL.

Link copied to clipboard

DSL builder for bulk insert or update statements.

Link copied to clipboard
open class BulkInsertStatementBuilder<T : BaseTable<*>>(table: T)

DSL builder for bulk insert statements.

Link copied to clipboard
data class Cube(val x: DoubleArray, val y: DoubleArray)

Represents a box suitable for an indexed search using the cube @> operator. Part of PostgreSQL cube SQL extension. https://www.postgresql.org/docs/9.5/cube.html

Link copied to clipboard
data class CubeExpression<T : Any>(val type: CubeExpressionType, val left: ScalarExpression<*>, val right: ScalarExpression<*>, val sqlType: SqlType<T>, val isLeafNode: Boolean = false, val extraProperties: Map<String, Any> = emptyMap()) : ScalarExpression<T>

Expression class represents PostgreSQL Cube operations.

Link copied to clipboard

Enum for 'cube' and 'earthdistance' binary operators.

Link copied to clipboard

Represents a Cube by storing 2 n-dimensional points Part of PostgreSQL cube SQL extension. https://www.postgresql.org/docs/9.5/cube.html

Link copied to clipboard
data class DefaultValueExpression<T : Any>(val sqlType: SqlType<T>, val isLeafNode: Boolean = true, val extraProperties: Map<String, Any> = emptyMap()) : ScalarExpression<T>

Default value expression, translated to the default keyword in PostgreSQL, used in insert statements.

Link copied to clipboard

SqlType implementation represents PostgreSQL float8[] type.

Link copied to clipboard

Cube-based earth abstraction, using 3 coordinates representing the x, y, and z distance from the center of the Earth. Part of PostgreSQL earthdistance extension. https://www.postgresql.org/docs/12/earthdistance.html

Link copied to clipboard

Cube-based earth abstraction, using 3 coordinates representing the x, y, and z distance from the center of the Earth. Part of PostgreSQL earthdistance SQL extension.

Link copied to clipboard

SqlType implementation represents PostgreSQL real[] type.

Link copied to clipboard
typealias HStore = Map<String, String?>

Represent values of PostgreSQL hstore SQL type.

Link copied to clipboard
data class HStoreExpression<T : Any>(val type: HStoreExpressionType, val left: ScalarExpression<HStore>, val right: ScalarExpression<*>, val sqlType: SqlType<T>, val isLeafNode: Boolean = false, val extraProperties: Map<String, Any> = emptyMap()) : ScalarExpression<T>

Expression class represents PostgreSQL hstore operations.

Link copied to clipboard

Enum for hstore operators.

Link copied to clipboard

SqlType implementation represents PostgreSQL hstore type.

Link copied to clipboard
data class ILikeExpression(val left: ScalarExpression<*>, val right: ScalarExpression<*>, val sqlType: SqlType<Boolean> = BooleanSqlType, val isLeafNode: Boolean = false, val extraProperties: Map<String, Any> = emptyMap()) : ScalarExpression<Boolean>

ILike expression, represents PostgreSQL ilike keyword.

Link copied to clipboard
data class InsertOrUpdateExpression(val table: TableExpression, val assignments: List<ColumnAssignmentExpression<*>>, val conflictColumns: List<ColumnExpression<*>> = emptyList(), val updateAssignments: List<ColumnAssignmentExpression<*>> = emptyList(), val returningColumns: List<ColumnExpression<*>> = emptyList(), val isLeafNode: Boolean = false, val extraProperties: Map<String, Any> = emptyMap()) : SqlExpression

Insert or update expression, represents an insert statement with an on conflict (key) do update set clause in PostgreSQL.

Link copied to clipboard

DSL builder for insert or update on conflict clause.

Link copied to clipboard

DSL builder for insert or update statements.

Link copied to clipboard

SqlType implementation represents PostgreSQL integer[] type.

Link copied to clipboard
data class LockingClause(val mode: LockingMode, val tables: List<TableExpression>, val wait: LockingWait)

PostgreSQL locking clause. See https://www.postgresql.org/docs/13/sql-select.html#SQL-FOR-UPDATE-SHARE

Link copied to clipboard

PostgreSQL locking mode.

Link copied to clipboard

PostgreSQL wait strategy for locked records.

Link copied to clipboard

SqlType implementation represents PostgreSQL bigint[] type.

Link copied to clipboard

Base class of PostgreSQL DSL builders, provide basic functions used to build assignments for insert or update DSL.

Link copied to clipboard

SqlDialect implementation for PostgreSQL database.

Link copied to clipboard

Base interface designed to visit or modify PostgreSQL expression trees using visitor pattern.

Link copied to clipboard
open class PostgreSqlFormatter(database: Database, beautifySql: Boolean, indentSize: Int) : SqlFormatter, PostgreSqlExpressionVisitor

SqlFormatter implementation for PostgreSQL, formatting SQL expressions as strings with their execution arguments.

Link copied to clipboard

SqlType implementation represents PostgreSQL smallint[] type.

Link copied to clipboard
typealias TextArray = Array<String?>

Represent values of PostgreSQL text[] SQL type.

Link copied to clipboard

SqlType implementation represents PostgreSQL text[] type.

Functions

Link copied to clipboard
@JvmName(name = "textArrayPosition")
fun arrayPosition(array: TextArray, value: ColumnDeclaring<String>, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "booleanArrayPosition")
fun arrayPosition(array: BooleanArray, value: ColumnDeclaring<Boolean>, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "intArrayPosition")
fun arrayPosition(array: IntArray, value: ColumnDeclaring<Int>, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "longArrayPosition")
fun arrayPosition(array: LongArray, value: ColumnDeclaring<Long>, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "shortArrayPosition")
fun arrayPosition(array: ShortArray, value: ColumnDeclaring<Short>, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "textArrayPosition")
fun arrayPosition(array: ColumnDeclaring<TextArray>, value: String, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "textArrayPosition")
fun arrayPosition(array: ColumnDeclaring<TextArray>, value: ColumnDeclaring<String>, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "booleanArrayPosition")
fun arrayPosition(array: ColumnDeclaring<BooleanArray>, value: Boolean, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "booleanArrayPosition")
fun arrayPosition(array: ColumnDeclaring<BooleanArray>, value: ColumnDeclaring<Boolean>, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "intArrayPosition")
fun arrayPosition(array: ColumnDeclaring<IntArray>, value: Int, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "intArrayPosition")
fun arrayPosition(array: ColumnDeclaring<IntArray>, value: ColumnDeclaring<Int>, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "longArrayPosition")
fun arrayPosition(array: ColumnDeclaring<LongArray>, value: Long, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "longArrayPosition")
fun arrayPosition(array: ColumnDeclaring<LongArray>, value: ColumnDeclaring<Long>, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "shortArrayPosition")
fun arrayPosition(array: ColumnDeclaring<ShortArray>, value: Short, offset: Int? = null): FunctionExpression<Int>
@JvmName(name = "shortArrayPosition")
fun arrayPosition(array: ColumnDeclaring<ShortArray>, value: ColumnDeclaring<Short>, offset: Int? = null): FunctionExpression<Int>

Returns the subscript of the first occurrence of the second argument in the array, or NULL if it's not present. If the third argument is given, the search begins at that subscript. The array must be one-dimensional.

Link copied to clipboard

Define a column typed BooleanArraySqlType.

Link copied to clipboard

Construct a bulk insert expression in the given closure, then execute it and return the effected row count.

fun <T : BaseTable<*>> Database.bulkInsert(table: T, block: BulkInsertStatementBuilder<T>.(T) -> Unit): Int

Bulk insert records to the table and return the effected row count.

Link copied to clipboard

Bulk insert records to the table, determining if there is a key conflict while inserting each of them, and automatically performs updates if any conflict exists.

Link copied to clipboard

Bulk insert records to the table, determining if there is a key conflict while inserting each of them, automatically performs updates if any conflict exists, and finally returns the specific columns.

Bulk insert records to the table, determining if there is a key conflict while inserting each of them, automatically performs updates if any conflict exists, and finally returns the specific column.

Link copied to clipboard
fun <T : BaseTable<*>, C1 : Any, C2 : Any> Database.bulkInsertReturning(table: T, returning: Pair<Column<C1>, Column<C2>>, block: BulkInsertStatementBuilder<T>.(T) -> Unit): List<Pair<C1?, C2?>>
fun <T : BaseTable<*>, C1 : Any, C2 : Any, C3 : Any> Database.bulkInsertReturning(table: T, returning: Triple<Column<C1>, Column<C2>, Column<C3>>, block: BulkInsertStatementBuilder<T>.(T) -> Unit): List<Triple<C1?, C2?, C3?>>

Bulk insert records to the table and return the specific columns' values.

fun <T : BaseTable<*>, C : Any> Database.bulkInsertReturning(table: T, returning: Column<C>, block: BulkInsertStatementBuilder<T>.(T) -> Unit): List<C?>

Bulk insert records to the table and return the specific column's values.

Link copied to clipboard
@JvmName(name = "earthContainedIn")
fun ColumnDeclaring<Earth>.containedIn(argument: Cube): CubeExpression<Boolean>

Cube contained in operator, translated to the <@ operator in PostgreSQL.

HStore contained-in operator, translated to the <@ operator in PostgreSQL.

Link copied to clipboard

HStore contains operator, translated to the @> operator in PostgreSQL.

@JvmName(name = "containsEarth")
fun ColumnDeclaring<Cube>.contains(argument: Earth): CubeExpression<Boolean>

Cube contains operator, translated to the @> operator in PostgreSQL.

Link copied to clipboard

HStore contains-all-keys operator, translated to the ?& operator in PostgreSQL.

Link copied to clipboard

HStore contains-any-keys operator, translated to the ?| operator in PostgreSQL.

Link copied to clipboard

HStore contains-key operator, translated to the ? operator in PostgreSQL.

Link copied to clipboard
fun BaseTable<*>.cube(name: String): Column<Cube>

Define a column typed CubeSqlType.

Link copied to clipboard

Return a default value for this column, see DefaultValueExpression.

Link copied to clipboard

Define a column typed DoubleArraySqlType.

Link copied to clipboard

Define a column typed EarthSqlType.

Link copied to clipboard

Returns a box suitable for an indexed search using the cube @> operator for points within a given great circle distance of a location. Some points in this box are further than the specified great circle distance from the location, so a second check using earth_distance should be included in the query.

Link copied to clipboard

Returns the great circle distance between two points on the surface of the Earth.

Link copied to clipboard

Define a column typed FloatArraySqlType.

Link copied to clipboard
@JvmName(name = "getValues")
operator fun ColumnDeclaring<HStore>.get(argument: TextArray): HStoreExpression<TextArray>

HStore get-values-for-keys operator, translated to the -> operator in PostgreSQL.

@JvmName(name = "getValue")
operator fun ColumnDeclaring<HStore>.get(argument: String): HStoreExpression<String>
@JvmName(name = "getValue")
operator fun ColumnDeclaring<HStore>.get(expr: ColumnDeclaring<String>): HStoreExpression<String>

HStore get-value-for-key operator, translated to the -> operator in PostgreSQL.

Link copied to clipboard

Define a column typed HStoreSqlType.

Link copied to clipboard
infix fun ColumnDeclaring<*>.ilike(argument: String): ILikeExpression

ILike operator, translated to the ilike keyword in PostgreSQL.

Link copied to clipboard

Insert a record to the table, determining if there is a key conflict while it's being inserted, and automatically performs an update if any conflict exists.

Link copied to clipboard
fun <T : BaseTable<*>, C1 : Any, C2 : Any> Database.insertOrUpdateReturning(table: T, returning: Pair<Column<C1>, Column<C2>>, block: InsertOrUpdateStatementBuilder.(T) -> Unit): Pair<C1?, C2?>
fun <T : BaseTable<*>, C1 : Any, C2 : Any, C3 : Any> Database.insertOrUpdateReturning(table: T, returning: Triple<Column<C1>, Column<C2>, Column<C3>>, block: InsertOrUpdateStatementBuilder.(T) -> Unit): Triple<C1?, C2?, C3?>

Insert a record to the table, determining if there is a key conflict while it's being inserted, automatically performs an update if any conflict exists, and finally returns the specific columns.

fun <T : BaseTable<*>, C : Any> Database.insertOrUpdateReturning(table: T, returning: Column<C>, block: InsertOrUpdateStatementBuilder.(T) -> Unit): C?

Insert a record to the table, determining if there is a key conflict while it's being inserted, automatically performs an update if any conflict exists, and finally returns the specific column.

Link copied to clipboard
fun <T : BaseTable<*>, C1 : Any, C2 : Any> Database.insertReturning(table: T, returning: Pair<Column<C1>, Column<C2>>, block: AssignmentsBuilder.(T) -> Unit): Pair<C1?, C2?>
fun <T : BaseTable<*>, C1 : Any, C2 : Any, C3 : Any> Database.insertReturning(table: T, returning: Triple<Column<C1>, Column<C2>, Column<C3>>, block: AssignmentsBuilder.(T) -> Unit): Triple<C1?, C2?, C3?>

Insert a record to the table and return the specific columns.

fun <T : BaseTable<*>, C : Any> Database.insertReturning(table: T, returning: Column<C>, block: AssignmentsBuilder.(T) -> Unit): C?

Insert a record to the table and return the specific column.

Link copied to clipboard

Define a column typed IntArraySqlType.

Link copied to clipboard

Returns the latitude in degrees of a point on the surface of the Earth.

Link copied to clipboard

Returns the location of a point on the surface of the Earth given its latitude (argument 1) and longitude (argument 2) in degrees.

Link copied to clipboard
fun Query.locking(mode: LockingMode, tables: List<BaseTable<*>> = emptyList(), wait: LockingWait = WAIT): Query
fun <E : Any, T : BaseTable<E>> EntitySequence<E, T>.locking(mode: LockingMode, tables: List<BaseTable<*>> = emptyList(), wait: LockingWait = WAIT): EntitySequence<E, T>

Specify the locking clause of this query, an example generated SQL could be:

Link copied to clipboard

Define a column typed LongArraySqlType.

Link copied to clipboard

Returns the longitude in degrees of a point on the surface of the Earth.

Link copied to clipboard
@JvmName(name = "minusKeys")
operator fun ColumnDeclaring<HStore>.minus(argument: TextArray): HStoreExpression<HStore>

HStore delete-keys operator, translated to the - operator in PostgreSQL.

@JvmName(name = "minusKey")
operator fun ColumnDeclaring<HStore>.minus(argument: String): HStoreExpression<HStore>

HStore delete-key operator, translated to the - operator in PostgreSQL.

@JvmName(name = "minusMatching")
operator fun ColumnDeclaring<HStore>.minus(argument: HStore): HStoreExpression<HStore>
@JvmName(name = "minusMatching")
operator fun ColumnDeclaring<HStore>.minus(expr: ColumnDeclaring<HStore>): HStoreExpression<HStore>

HStore delete-matching-pairs operator, translated to the - operator in PostgreSQL.

Link copied to clipboard

Cube overlap operator, translated to the && operator in PostgreSQL.

Link copied to clipboard

HStore concatenate operator, translated to the || operator in PostgreSQL.

Link copied to clipboard

Define a column typed ShortArraySqlType.

Link copied to clipboard

Define a column typed TextArraySqlType.