docs/api/exposed-jdbc/org.jetbrains.exposed.v1.jdbc/replace.html
fun <T : Table> T.replace(body: T.(UpdateBuilder<*>) -> Unit): ReplaceStatement<Long>
Represents the SQL statement that either inserts a new row into a table, or, if insertion would violate a unique constraint, first deletes the existing row before inserting a new row.
Note: This operation is not supported by all vendors, please check the documentation.
org.jetbrains.exposed.v1.tests.shared.dml.ReplaceTests.testReplaceWithExpression
fun <T : Table> T.replace(selectQuery: AbstractQuery<*>, columns: List<Column<*>>? = null): Int?
Represents the SQL statement that uses data retrieved from a selectQuery to either insert a new row into a table, or, if insertion would violate a unique constraint, first delete the existing row before inserting a new row.
Note: This operation is not supported by all vendors, please check the documentation.
The number of inserted (and possibly deleted) rows, or null if nothing was retrieved after statement execution.
selectQuery
Source SELECT query that provides the values to insert.
columns
Columns to either insert values into or delete values from then insert into. This defaults to all columns in the table that are not auto-increment columns without a valid sequence to generate new values.
org.jetbrains.exposed.v1.tests.shared.dml.ReplaceTests.testReplaceSelect
Generated by Dokka © 2026 Copyright