SQLite User Forum

How should RETURNING work with a cascading delete?
Login
Definitely the latter.

The main reason a programmer needs RETURNING is that he/she can ascertain which rows he/she caused to be added/deleted/touched directly and not as a consequence of a FK or TRIGGER or other Schemata, that is for the DB Schema's concern, and if perchance a programmer IS interested in all effects, that is the complicated case and then more queries are warranted.

The latter case is how it works in *most* engines and is expected to work *in the general case* (I can't speak for ALL engines or ALL expectations of course).



PS: It's very exciting seeing the question asked. :)