Join Slack
Powered by
Is there an easy way to retrieve the primary key o...
# exposed
c
cedric
03/19/2019, 3:35 AM
Is there an easy way to retrieve the primary key of an
insert
(in the case where it's auto increment, obviously, otherwise I already have it)
s
spand
03/19/2019, 6:37 AM
get[autoincrementColumn]!!
t
tapac
03/19/2019, 6:55 AM
If you use IdTable and your primary key is also an auto-increment, you can use :
FooTable.insertAndGetId()
c
cedric
03/20/2019, 4:49 PM
@spand
That’s exactly how I ended up solving it before seeing your suggestion, thank you both
6
Views
Open in Slack
Previous
Next