quick Update
fun <T : KQLiteTable> T.quickUpdate(binding: Bind.(T) -> Unit, where: Clause.(T) -> Unit?, connection: SQLiteConnection? = null)
Performs a quick and simple UPDATE operation on the table.
This is a convenience function for executing a basic UPDATE statement without the need to build a full UpdateStatement. It's ideal for simple updates where you only need to set new values and specify a WHERE clause.
CAUTION: Null or empty where block will execute the query without WHERE clause.
Example
// Updates the name of a employee with a specific ID
Employees.quickUpdate(
binding = {
it.firstName.bind("New Name")
},
where = {
it.employeeId EQ 1
}
)Content copied to clipboard
Author
MOHAMMAD AZIM ANSARI
Parameters
binding
A lambda function to define the columns and their new values. The Bind receiver provides a convenient way to pair columns with values (e.g., it.column to "new value").
where
An optional lambda function to construct the WHERE clause of the update statement. If null, all rows in the table will be updated.
Type Parameters
T
The type of the KQLiteTable being updated.