SQLite Forum

Are there any plans / chances of supporting a RETURNING clause?
Login
It has little to do with displaying the data Keith, and is all about  
keeping the in-memory representation of the data in-sync with the  
persistent store (SQLite) of that same data, when part of the data  
is generated **by** the datastore (SQLite). That includes the good old  
[rowid][1], but now more content can be *SQLite-side generated*, given  
UPSERT, Generated columns, triggers, etc...

`last_insert_rowid()` is basically *global state*, which is generally  
a bad thing, and makes much more sense as a `RETURNING` clause. In fact  
clients not interested in that rowid still have to pay for it being  
stored, while with `RETURNING` only those explicitly asking for it would.

Of course BC mandates everyone will have to pay for it forever, still,  
I don't see why anyone would agree this to be a good thing. Had `RETURNING`  
been available then, we'd never have had `last_insert_rowid()` perhaps.  
Which now that there are `WITHOUT ROWID` tables, feel all a misfeature.

[1]: https://sqlite.org/c3ref/last_insert_rowid.html