DeleteStatement

open class DeleteStatement(val targetsSet: ColumnSet, val where: Op<Boolean>? = null, val isIgnore: Boolean = false, val limit: Int? = null, val targetTables: List<Table> = emptyList()) : Statement<Int>

Represents the SQL statement that deletes one or more rows of a table.

Parameters

targetsSet

Column set to delete rows from. This may be a Table or a Join instance.

where

Condition that determines which rows to delete.

isIgnore

Whether to ignore errors or not. Note isIgnore is not supported by all vendors. Please check the documentation.

limit

Maximum number of rows to delete.

targetTables

List of specific tables from targetsSet to delete rows from.

Constructors

Link copied to clipboard
constructor(table: Table, where: Op<Boolean>?, isIgnore: Boolean, limit: Int?, offset: Long?)
constructor(targetsSet: ColumnSet, where: Op<Boolean>? = null, isIgnore: Boolean = false, limit: Int? = null, targetTables: List<Table> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether the SQL statement is meant to be performed as part of a batch execution.

Link copied to clipboard
val isIgnore: Boolean = false
Link copied to clipboard
val limit: Int? = null
Link copied to clipboard
val offset: Long? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val where: Op<Boolean>? = null

Functions

Link copied to clipboard
open override fun arguments(): Iterable<Iterable<Pair<IColumnType<*>, Any?>>>

Returns all mappings of columns and expression types to their values needed to prepare an SQL statement.

Link copied to clipboard
fun execute(transaction: Transaction): Int?

Executes the SQL statement directly in the provided transaction and returns the generated result, or null if either no result was retrieved or if the transaction blocked statement execution.

Link copied to clipboard
open override fun PreparedStatementApi.executeInternal(transaction: Transaction): Int

Determines the exact way that an SQL statement is executed in a transaction and applies any necessary logic before returning the result generated by the executed statement.

Link copied to clipboard
open fun prepared(transaction: Transaction, sql: String): PreparedStatementApi

Uses a transaction connection and an sql string representation to return a precompiled SQL statement, stored as an implementation of PreparedStatementApi.

Link copied to clipboard
open override fun prepareSQL(transaction: Transaction, prepared: Boolean): String

Returns the string representation of an SQL statement.