Back to Exposed

insertAndGetId

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

1.2.01.1 KB
Original Source

insertAndGetId

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.tests.shared.dml.InsertTests.testGeneratedKey04

Generated by Dokka © 2026 Copyright