Skip to content

fix: sqlite generated key is named lastInsertRowid#1501

Open
johannes-vogel wants to merge 10 commits intomainfrom
fix-sqlite-generated-key
Open

fix: sqlite generated key is named lastInsertRowid#1501
johannes-vogel wants to merge 10 commits intomainfrom
fix-sqlite-generated-key

Conversation

@johannes-vogel
Copy link
Contributor

No description provided.

@johannes-vogel johannes-vogel marked this pull request as ready for review February 12, 2026 09:50
@@ -71,7 +71,7 @@ module.exports = class InsertResult {
// If no generated keys in entries/rows/values we might have database-generated keys
const rows = this.results.slice(0, this.affectedRows) // only up to # of root entries
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.results should always be of length 1, because of the json insert SQLite only executes a single operation. For this operation it will return the number of affected rows and the last row ID. There for the for loop needs to include an additional loop that walks from lastInsertRowid - affectedRows4 till lastInsertRowid.

@BobdenOs BobdenOs enabled auto-merge (squash) March 9, 2026 10:53
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.

2 participants