Integrated, working.
This integrates the liteq, and it prevents duplicates in a way that matches my use-case. I might try and push things back out to a separate module, but for now, this will do.
This commit is contained in:
@@ -20,10 +20,9 @@ VALUES
|
||||
unixepoch(),
|
||||
?,
|
||||
?
|
||||
) ON CONFLICT (deduping_key, job_status)
|
||||
) ON CONFLICT (deduping_key)
|
||||
WHERE
|
||||
deduping_key != ''
|
||||
AND (job_status = 'queued' OR job_status = 'fetched' OR job_status = 'completed') DO NOTHING;
|
||||
deduping_key != '' DO NOTHING;
|
||||
|
||||
-- name: doQueueJobReplaceDupe :exec
|
||||
INSERT INTO
|
||||
|
||||
@@ -21,10 +21,9 @@ WHERE
|
||||
job_status = 'queued'
|
||||
OR job_status = 'fetched';
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS dedupe_ignore ON jobs (deduping_key, job_status)
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS dedupe_ignore ON jobs (deduping_key)
|
||||
WHERE
|
||||
deduping_key != ''
|
||||
AND (job_status = 'queued' OR job_status = 'fetched' OR job_status = 'completed');
|
||||
deduping_key != '';
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS dedupe_replace ON jobs (deduping_key, job_status)
|
||||
WHERE
|
||||
|
||||
Reference in New Issue
Block a user