delete

Creates a DELETE statement builder for constructing a custom delete query.

This function initiates a DELETE statement, allowing you to chain methods like where(), orderBy(), and limit() to build a more complex query. The query is not executed until you call execute() or executeReturning() on the returned DeleteStatement.

Example:

// Deletes the oldest 5 users named "John"
MyTable.delete()
.where { it.name EQ "John" }
.orderBy(MyTable.creationDate, Sort.ASC)
.limit(5)
.execute()

For simple, one-off deletions, consider using quickDelete instead.

Return

A DeleteStatement instance that can be used to further configure and execute the DELETE query.

Author

MOHAMMAD AZIM ANSARI

Type Parameters

T

The type of the table, which must be a subtype of KQLiteTable.

See also


Same as delete() but executes on the given connection

Parameters

connection

An optional SQLiteConnection to use for the operation. If null, a cached connection will be used.