quickDelete

fun <T : KQLiteTable> T.quickDelete(connection: SQLiteConnection? = null, where: Clause.(T) -> Unit?)

Executes SQL DELETE and deletes rows from the table.

This is a convenience function for performing a simple delete operation without the need to build a full DeleteStatement. It executes the deletion immediately.

CAUTION: Null or empty where block will execute the query without WHERE clause.

Example:

MyTable.quickDelete {
it.id EQ 10
}

To delete all rows from the table, call it without the WHERE clause:

MyTable.quickDelete(where = null)

Author

MOHAMMAD AZIM ANSARI

Parameters

connection

An optional SQLiteConnection to use for this specific operation. If null, a default connection is used.

where

An optional lambda expression to specify the WHERE clause for the deletion. If null, all rows in the table will be deleted.

Type Parameters

T

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

See also