SQLite Forum

Efficiency of updates versus replace when using the JSON1 extension functions.
Login
SQlite implements update rather like INSERT INTO ... SELECT, only without spurious changing of rowids and avoiding anomalies from updating fields that change the visitation order of records.

e.g.:
create table t (id integer primary key, a integer, b jsontext, c real);

then running

update t set b = json_set(b,...) where ...;

will execute like

create temp table new_t as select id,a,json_set(b,...),c from t where ...;
replace into t select * from new_t;
drop table new_t;

Doing the same would require preparing two statements

select id,b from t where ...;
update t set b = ? where id = ?;

and hoping that the visitation order is not based on field b.