IStatementBuilder

Represents all the DSL methods available when building SQL statements.

Functions

Link copied to clipboard
open fun <T : Table, E> T.batchInsert(    ignoreErrors: Boolean = false,     shouldReturnGeneratedValues: Boolean = true,     body: BatchInsertStatement.(E) -> Unit): BatchInsertStatement

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

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

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
open fun <T : Table, E> T.batchUpsert(    onUpdateList: List<Pair<Column<*>, Any?>>? = null,     onUpdate: UpsertBuilder.(UpdateStatement) -> Unit? = null,     onUpdateExclude: List<Column<*>>? = null,     where: SqlExpressionBuilder.() -> Op<Boolean>? = null,     shouldReturnGeneratedValues: Boolean = true,     vararg keys: Column<*>,     body: BatchUpsertStatement.(E) -> Unit): BatchUpsertStatement

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

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

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

Link copied to clipboard

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

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

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.

Link copied to clipboard
open fun <T : Table> T.deleteReturning(    returning: List<Expression<*>> = columns,     where: SqlExpressionBuilder.() -> Op<Boolean>? = null): ReturningStatement

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

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

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

Link copied to clipboard
open fun <T : Table> T.insert(body: T.(UpdateBuilder<*>) -> Unit): InsertStatement<Number>

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

open fun <T : Table> T.insert(selectQuery: AbstractQuery<*>, columns: List<Column<*>>? = null): InsertSelectStatement

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

Link copied to clipboard
open fun <T : Table> T.insertIgnore(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.

open fun <T : Table> T.insertIgnore(selectQuery: AbstractQuery<*>, columns: List<Column<*>>? = null): InsertSelectStatement

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
open fun <T : Table> T.insertReturning(    returning: List<Expression<*>> = columns,     ignoreErrors: Boolean = false,     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
open fun <D : Table, S : Table> D.mergeFrom(    source: S,     on: SqlExpressionBuilder.() -> Op<Boolean>? = null,     body: MergeTableStatement.() -> Unit): MergeTableStatement

Represents the SQL statement that inserts, updates, or deletes records in a target table based on a comparison with a source table.

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

Represents the SQL statement that inserts, updates, or deletes records in a target table based on a comparison with a select query source.

Link copied to clipboard
open fun <T : Table> T.replace(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.

open fun <T : Table> T.replace(selectQuery: AbstractQuery<*>, columns: List<Column<*>>? = null): ReplaceSelectStatement

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
open fun <T : Table> T.update(    where: SqlExpressionBuilder.() -> Op<Boolean>? = null,     limit: Int? = null,     body: T.(UpdateStatement) -> Unit): UpdateStatement

Represents the SQL statement that updates rows of a table.

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

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

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

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

Link copied to clipboard
open 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.

Link copied to clipboard
open 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.