mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-28 17:06:22 +00:00
refactor(database): use ON CONFLICT for deduplication
Replace 'INSERT OR IGNORE' with 'INSERT ... ON CONFLICT(`archive_id`) DO NOTHING RETURNING id'. This is only available since sqlite 3.35.0. So deduplication only happens for `archive_id` and we don't silently ignore other errors or constraints (like not null). We can now detect if an insertion was skipped due to duplication by checking the result of 'RETURNING id'. We don't print out when we don't insert duplicated messages since this will happen often and will be too noisy. So we match the behaviour of what Dino is doing. Signed-off-by: Michael Vetter <jubalh@iodoru.org>
This commit is contained in:
@@ -92,7 +92,7 @@ endif
|
||||
glib_dep = dependency('glib-2.0', version: '>= 2.62.0')
|
||||
gio_dep = dependency('gio-2.0')
|
||||
curl_dep = dependency('libcurl', version: '>= 7.62.0')
|
||||
sqlite_dep = dependency('sqlite3', version: '>= 3.22.0')
|
||||
sqlite_dep = dependency('sqlite3', version: '>= 3.35.0')
|
||||
thread_dep = dependency('threads')
|
||||
math_dep = cc.find_library('m')
|
||||
libstrophe_dep = dependency('libstrophe', version: '>= 0.12.3')
|
||||
|
||||
Reference in New Issue
Block a user