onConflict
Configures behavior in case of a key conflict (ON CONFLICT clause).
// Re-enlist a legionnaire — update their status if they already exist
dataAccess.insertInto("legionnaires")
.values(data)
.onConflict {
onColumns("name", "legion_id")
doUpdate(
"status" to "EXCLUDED.status",
"re_enlisted_at" to "NOW()"
)
}
.execute(data)Content copied to clipboard