kotlinkotlin-exposed

How to get the inserted row in Kotlin Exposed?


Here is how we get the id of the added row (source):

val munichId = Cities.insert {
    it[name] = "Munich"
} get Cities.id

What about getting the whole row? I use map for select operations but it does not work for insert.


Solution

  • val row = Cities.insert {
        it[name] = "Munich"
    }.resultedValues!!.first()