Knowing if you actually did anything with UPSERT (INSERT ... ON CONFLICT(..) DO UPDATE)

I’ve recently been collecting some data and stored it in an SQLite database. Since the primary key isn’t mine, I have to use an UPSERT statement which updates the existing entities. For logging purposes it would be nice to know what the operation actually accomplished. I’ve looked around and couldn’t find a ready done solution but poking at sqlite internals I’ve found last_inserted_rowid() which I…