# UpsertBuilder

sealed interface UpsertBuilder

Common interface for building SQL statements that either insert a new row into a table, or update the existing row if insertion would violate a unique constraint.

#### Inheritors

BatchUpsertStatement
UpsertStatement

## Types

Companion
Link copied to clipboard
object Companion

## Functions

insertValue
Link copied to clipboard
open fun <T> insertValue(column: Column<T>): ExpressionWithColumnType<T>

Specifies that this column should be updated using the same values that would be inserted if there was no violation of a unique constraint in an upsert statement.

storeUpdateValues
Link copied to clipboard
open fun storeUpdateValues(onUpdate: UpsertBuilder.(UpdateStatement) -> Unit)

Calls the specified function onUpdate with an UpdateStatement as its argument, allowing values to be stored as part of the UPDATE clause of the upsert statement associated with this builder.