update

suspend fun <T : Table> T.update(where: () -> Op<Boolean>, limit: Int? = null, body: T.(UpdateStatement) -> Unit): Int

Represents the SQL statement that updates rows of a table.

Return

The number of updated rows.

Parameters

where

Condition that determines which rows to update.

limit

Maximum number of rows to update.

Samples

org.jetbrains.exposed.v1.r2dbc.sql.tests.shared.dml.UpdateTests.testUpdate01
suspend fun <T : Table> T.update(limit: Int? = null, body: T.(UpdateStatement) -> Unit): Int

Represents the SQL statement that updates all rows of a table.

Return

The number of updated rows.

Parameters

limit

Maximum number of rows to update.

Samples

org.jetbrains.exposed.v1.r2dbc.sql.tests.shared.dml.UpdateTests.testUpdate01
suspend fun Join.update(where: () -> Op<Boolean>, limit: Int? = null, body: (UpdateStatement) -> Unit): Int

Represents the SQL statement that updates rows of a join relation.

Return

The number of updated rows.

Parameters

where

Condition that determines which rows to update.

limit

Maximum number of rows to update.

Samples

org.jetbrains.exposed.v1.r2dbc.sql.tests.shared.dml.UpdateTests.testUpdateWithSingleJoin
suspend fun Join.update(limit: Int? = null, body: (UpdateStatement) -> Unit): Int

Represents the SQL statement that updates all rows of a join relation.

Return

The number of updated rows.

Parameters

limit

Maximum number of rows to update.

Samples

org.jetbrains.exposed.v1.r2dbc.sql.tests.shared.dml.UpdateTests.testUpdateWithSingleJoin