UpsertStatement

class UpsertStatement<Key : Any>(table: Table, conflictColumn: Column<*>? = null, conflictIndex: Index? = null) : InsertStatement<Key>

An InsertStatement that appends a PostgreSQL ON CONFLICT ... DO UPDATE SET clause.

Generates SQL that inserts a row, and on conflict with the specified column or index constraint, updates all non-conflict columns to the EXCLUDED values.

Parameters

table

the target table

conflictColumn

the unique column for conflict detection (mutually exclusive with conflictIndex)

conflictIndex

the unique index for conflict detection (mutually exclusive with conflictColumn)

Type Parameters

Key

the auto-generated key type

Throws

Constructors

Link copied to clipboard
constructor(table: Table, conflictColumn: Column<*>? = null, conflictIndex: Index? = null)

Properties

Link copied to clipboard
open var arguments: List<List<Pair<Column<*>, Any?>>>?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var resultedValues: List<ResultRow>?
Link copied to clipboard
val table: Table
Link copied to clipboard
val targets: List<Table>
Link copied to clipboard
val type: StatementType
Link copied to clipboard
val values: MutableMap<Column<*>, Any?>

Functions

Link copied to clipboard
open override fun arguments(): List<Iterable<Pair<IColumnType<*>, Any?>>>
Link copied to clipboard
Link copied to clipboard
open operator fun contains(column: Column<*>): Boolean
Link copied to clipboard
infix operator fun <T> get(column: Column<T>): T
infix operator fun <T> get(column: CompositeColumn<T>): T
Link copied to clipboard
fun <T> getOrNull(column: Column<T>): T?
Link copied to clipboard
open override fun prepareSQL(transaction: Transaction, prepared: Boolean): String
Link copied to clipboard
open operator fun <S> set(column: Column<S>, value: S)
open operator fun <T, S : T?, E : Expression<S>> set(column: Column<T>, value: E)
open operator fun <S> set(column: Column<S>, value: AbstractQuery<*>)
@JvmName(name = "setWithEntityIdExpression")
operator fun <S, ID : EntityID<S>, E : Expression<S>> set(column: Column<ID>, value: E)
@JvmName(name = "setWithNullableEntityIdValue")
operator fun <S : Any> set(column: Column<EntityID<S>?>, value: S?)
@JvmName(name = "setWithEntityIdValue")
operator fun <S : Any> set(column: Column<EntityID<S>>, value: S)
open operator fun <S> set(column: CompositeColumn<S>, value: S)
Link copied to clipboard
open fun <T, S : T?> update(column: Column<T>, value: () -> Expression<S>)
open fun <T, S : T?> update(column: Column<T>, value: Expression<S>)