Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execute() returning void vs Autoincrement #1015

Closed
davidkraus opened this issue Oct 18, 2018 · 5 comments
Closed

execute() returning void vs Autoincrement #1015

davidkraus opened this issue Oct 18, 2018 · 5 comments

Comments

@davidkraus
Copy link

I just updated to 1.0.0-rc2. I saw that you changed the execute function to return void. The thing is that i now no longer get the id that was inserted (i use autoincrement).

I think to get around this i can just manually call last_insert_rowid() or am i missing something here?

@davidkraus
Copy link
Author

ok this is not working since i have no access to the connection that does the inserting (calling last_insert_rowid() in a new connection returns 0).

@vanniktech
Copy link
Contributor

This PR in SdkSearch might help - https://github.com/JakeWharton/SdkSearch/pull/135/files

@davidkraus
Copy link
Author

exactly what i was looking for ;) thanks

@vincent-paing
Copy link

How do still get the last inserted id when you're using auto increment? I get that you can check wether you should update or insert but what if I need to insert a row and then use that inserted id to also update on another table?

@JakeWharton
Copy link
Member

JakeWharton commented Jan 30, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants