Commit Graph

2 Commits

Author SHA1 Message Date
Marco Bubke
c1ca2a7103 Sqlite: Fix insertUpdateDelete
Like you can read in https://www.sqlite.org/isolation.html after an
update they same value can be show up for an iterator advancement. This
would be lead to an delete. So the last value for update is saved and
then compared in the delete method. If they are equal the delete is
skipped.

Change-Id: Ic0aa6619f6a4a520eac77be4e5a83cbe533d102d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-12-08 15:01:39 +00:00
Marco Bubke
7b330d3496 Sqlite: Add insertUpdateRemove
An generic approach to merge values into a database. It is comparing
two ranges. The first range is the Sqlite select range and the second
one which are the new values. New values are inserted, change are
updated and missing values are removed. Unchanged values are not
touched. The compare function is comparing a key. Both ranges are
binary ordered.

Change-Id: I973c83677ea74f8fa62bd7ab8a73ed560c806562
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:02 +00:00