This does look very useful - I’ve often thought of the INSERT/EPLACE style but the implicit DELETE [when REPLACE occurs] was a barrier - it causes [as I understand it] CASCADE DELETE to be in effect. It seems that this UPSERT style does not cause that effect.
> On Jan 8, 2020, at 5:22 AM, Richard Hipp <d...@sqlite.org> wrote: > > On 1/7/20, Michael Kappert <michael.kapp...@gmx.net> wrote: >> >> If I understand correctly, the upsert should behave like UPDATE in the >> examples above, but it behaves like a DELETE followed by INSERT instead? >> > > REPLACE and UPSERT are different things. See > https://www.sqlite.org/lang_conflict.html for information about > REPLACE and https://www.sqlite.org/lang_UPSERT.html for information > about UPSERT. > > REPLACE works by first DELETE-ing any rows that would cause a conflict > and then doing the INSERT. > > UPDATE works by converting the INSERT into an UPDATE. > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users