Back to Exposed

insertAndGetId

docs/api/exposed-r2dbc/org.jetbrains.exposed.v1.r2dbc/insert-and-get-id.html

1.2.01.1 KB
Original Source

insertAndGetId

suspend fun <Key : Any, T : IdTable<Key>> T.insertAndGetId(body: T.(InsertStatement<EntityID<Key>>) -> Unit): EntityID<Key>

Represents the SQL statement that inserts a new row into a table.

Return

The generated ID for the new row.

Samples

org.jetbrains.exposed.v1.r2dbc.sql.tests.shared.dml.InsertTests.testGeneratedKey04

Generated by Dokka © 2026 Copyright