OnConflictClause

class OnConflictClause @PublishedApi constructor

The ON CONFLICT clause of an InsertQuery, configured inside InsertQuery.onConflict. The target is optional; an action is required.

Constructors

Link copied to clipboard
internal constructor()

Functions

Link copied to clipboard
internal fun copyInto(other: OnConflictClause)
Link copied to clipboard
fun doNothing()

Leaves the existing row alone and inserts nothing.

Link copied to clipboard
fun doUpdate(setExpression: String, whereCondition: String? = null)

Updates the existing row. setExpression is the SET body as SQL, in which excluded is the row that could not be inserted: doUpdate("cognomen = excluded.cognomen, updated_at = now()"). whereCondition limits which conflicting rows are updated.

fun doUpdate(setMap: Map<String, String>, whereCondition: String? = null)

As doUpdate, with the assignments given as a column-to-expression map.

fun doUpdate(vararg setPairs: Pair<String, String>, whereCondition: String? = null)

As doUpdate, with the assignments given as column-to-expression pairs.

Link copied to clipboard
fun onColumns(vararg columns: String, where: String? = null)

Conflicts on a unique index over columns, which may be expressions. where is the index predicate; null or blank leaves it out.

Link copied to clipboard
fun onConstraint(constraintName: String)

Conflicts on a named constraint.

Link copied to clipboard
internal fun render(): String