runInTransaction

suspend fun <R> runInTransaction(database: RoomDatabase, block: suspend (transactor: Transactor) -> R): R

Runs the given block in a transaction (for write operations)

as documented here: https://developer.android.com/kotlin/multiplatform/room#transactions