better-sqlite3
better-sqlite3 copied to clipboard
lastInsertRowid wrong for upserts
It appears the library returns an incorrect lastInsertRowid
for queries such as
INSERT INTO "Account" ( "address" , "balance" )
VALUES ( @address , @balance )
ON CONFLICT DO UPDATE SET "address" = excluded."address", "balance" = excluded."balance"
the incorrect id is always the last inserted id of a row of an unrelated table in the database.
Can you please provide a minimal self-contained repro? Preferably a single JS file that only depends on better-sqlite3
and that sets everything up using a :memory:
db.
@Mwni , still waiting on that reproducible example...
Closing due to inactivity