OnConflictClause

class OnConflictClause @PublishedApi constructor

The ON CONFLICT clause of an InsertQuery, configured inside InsertQuery.onConflict.

A target is optional - PostgreSQL infers one for DO NOTHING - but an action is not, since a clause that says what to conflict on and nothing about what to do is not a clause.

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.

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)

Conflicts on a unique index over these columns.

Link copied to clipboard
fun onConstraint(constraintName: String)

Conflicts on a named constraint.

Link copied to clipboard
internal fun render(): String