Skip to content

Conversation

@dghaehre
Copy link

@dghaehre dghaehre commented Nov 8, 2023

When running db/insert you expect to get back what you have inserted or updated. But since the return value is currently based on sqlite3/last-insert-rowid there is a case where the return value is unexpected. This edge case has been captured in the added tests.

You first insert two rows.
And then run another insert with on conflict where you only end up updating the first row you inserted. You expect to get back the row you modified, but before this change you will get back the second row.

There is one breaking change here, which is that if you do an insert where nothing is modified, you will get back nil. I think that makes sense.

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

Successfully merging this pull request may close these issues.

1 participant