doUpdate

abstract fun doUpdate(setExpression: String, whereCondition: String? = null)

In case of conflict, perform an update (DO UPDATE).

Parameters

setExpression

SET expression. Use EXCLUDED to reference the values that were attempted to insert. E.g., "tribute_amount = EXCLUDED.tribute_amount".

whereCondition

Optional WHERE condition for the UPDATE action.


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

In case of conflict, perform an update (DO UPDATE) using column-value pairs. Preferred over the string overload — more readable and less error-prone.

doUpdate(
"tribute_amount" to "EXCLUDED.tribute_amount",
"last_collected_at" to "NOW()"
)

Parameters

setPairs

Pairs (column, expression) to use in the SET clause.

whereCondition

Optional WHERE condition for the UPDATE action.


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

In case of conflict, perform an update (DO UPDATE) using a column-value map. Useful when update logic is built dynamically.

Parameters

setMap

Map {column -> expression} to use in the SET clause.

whereCondition

Optional WHERE condition for the UPDATE action.