https://kotlinlang.org logo
#exposed
Title
# exposed
s

spand

11/06/2018, 10:35 AM
Looking at
InsertStatement.generatedKey
. Is there any particular usecase that isnt better handled by
get()
? With
get()
you get the correct type, while with
generatedKey
you need to
toInt()
it or similar. Asking as I would prefer to see it removed since I see some bad usages of it in our codebase.
t

tapac

11/06/2018, 12:15 PM
I think that it's rather rare when you have to ask
generatedKey
in your code. At first, if you use
IdTable.insertAndGetId
then you'll receive id value of proper type. So I agree that
generatedKey
looks like a legacy and could be hidden from a public scope. But (as you mentioned) many people already use that field and it may be too painful to just to remove the field but we can start with depreciation.
s

spand

11/06/2018, 12:21 PM
Good to hear you agree. Deprecation seems like a good first step.