update

fun <T : BaseTable<*>> Database.update(table: T, block: UpdateStatementBuilder.(T) -> Unit): Int(source)

Construct an update expression in the given closure, then execute it and return the effected row count.

Usage:

database.update(Employees) {
set(it.job, "engineer")
set(it.managerId, null)
set(it.salary, 100)
where {
it.id eq 2
}
}

Since

2.7

Return

the effected row count.

Parameters

table

the table to be updated.

block

the DSL block, an extension function of UpdateStatementBuilder, used to construct the expression.