docs/api/exposed-r2dbc/org.jetbrains.exposed.v1.r2dbc/merge-from.html
suspend fun <D : Table, S : Table> D.mergeFrom(source: S, on: () -> Op<Boolean>, body: MergeTableStatement.() -> Unit): MergeTableStatement
Performs an SQL MERGE operation to insert, update, or delete records in the target table based on a comparison with a source table.
A MergeTableStatement which represents the MERGE operation with the configured actions.
source
An instance of the source table.
on
A lambda function that should return a Op condition. This condition is used to match records between the source and target tables.
body
A lambda where MergeTableStatement can be configured with specific actions to perform when records are matched or not matched.
D
The target table type extending from Table.
S
The source table type extending from Table.
suspend fun <D : Table, S : Table> D.mergeFrom(source: S, body: MergeTableStatement.() -> Unit): MergeTableStatement
Performs an SQL MERGE operation to insert, update, or delete records in the target table based on a comparison with a source table.
A MergeTableStatement which represents the MERGE operation with the configured actions.
source
An instance of the source table.
body
A lambda where MergeTableStatement can be configured with specific actions to perform when records are matched or not matched.
D
The target table type extending from Table.
S
The source table type extending from Table.
suspend fun <T : Table> T.mergeFrom(selectQuery: QueryAlias, on: () -> Op<Boolean>, body: MergeSelectStatement.() -> Unit): MergeSelectStatement
Performs an SQL MERGE operation to insert, update, or delete records in the target table based on a comparison with a select query source.
A MergeSelectStatement which represents the MERGE operation with the configured actions.
selectQuery
represents the aliased query for a complex subquery to be used as the source.
on
A lambda that returns a condition Op used to match records between the source query and the target table.
body
A lambda where MergeSelectStatement can be configured with specific actions to perform when records are matched or not matched.
T
The target table type extending from Table.
Generated by Dokka © 2026 Copyright