I hope they build this in a way that returns the correct changed row count. Currently upserts in sqlite are a bit complicated because there is no feedback
https://www.sqlite.org/c3ref/last_insert_rowid.html
And if it's a table with autoincrement primary key, try: