SQLite affected row count and last_insert_rowid #3095
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3092.
WIP for nowThis adds two functions to the SQLite
connection
resource:changes()
- the number of rows affected by the last insert/delete/updatelast_insert_rowid()
- the rowid of the last inserted rowThe names are taken from the SQLite API, and I'm in favour of sticking with that standard rather than giving them names that might be more self-documenting (stop shuffling your feet at the back,
changes
).WIPness: the new functions appear to work but:
It needs testsAdded to the existing SQLite testIt needs a world update (for dev purposes I shoved it into the 3.0 world but that's not appropriate for shipping)Done - see separate comment belowI want to try to remove the v2/v3 duplicationDone (hopefully satisfactorily)I'm putting it into PR now so that 1. the integration tests pick up any regressions and 2. if folks have other things they want to put in then we can consider rolling them into a single rev.
The new interface is backward compatible and I did consider doing one of those "since" things to make it a minor version rev, which would eliminate all the duplication, but I provisionally went for a new interface because we are trying to shift from the
fermyon:
namespace to aspin:
namespace. Happy to receive feedback on this!