quick Insert
Executes SQL INSERT and inserts a single row into the table.
This is a convenience function for a simple insert operation. It creates, binds, executes, and closes an InsertStatement in a single call.
Conflict resolution algorithm can also be specified using onConflict action.
All columns in the table that do not have a default value must be bound in the binding lambda.
Example:
// Assume artistId is a primary key
Artists.quickInsert {
it.artistId.bind(1)
it.artistName.bind("SuperCoolMan")
}
// INSERT OR REPLACE ...
Artists.quickInsert(onConflict = Action.REPLACE) {
it.artistId.bind(1)
it.artistName.bind("SuperAwesomeMan")
}Author
MOHAMMAD AZIM ANSARI
Parameters
Optional conflict resolution strategy (e.g., Action.IGNORE, Action.REPLACE). If null, the default database conflict behavior is used.
An optional SQLiteConnection to use for this specific operation. If null, a default connection is used.
A lambda function with a Bind receiver to specify column-to-value mappings for the new row. The lambda also receives the table instance T as a parameter.
Type Parameters
The type of the KQLiteTable.
See also
Throws
if the binding is empty, a required column is not bound, or a database error occurs.