V3 version with backward comp

This commit is contained in:
m
2026-07-28 18:12:56 +02:00
parent 7713835739
commit bd6e7c38f9
48 changed files with 3685 additions and 1344 deletions
@@ -0,0 +1,27 @@
-- name: CreateSyncQueueItem :one
INSERT INTO sync_queue (resource_id, storage_location_id, operation, status, attempts)
VALUES ($1, $2, $3, $4, $5)
RETURNING *;
-- name: GetSyncQueueItem :one
SELECT * FROM sync_queue
WHERE id = $1;
-- name: ListPendingSyncItems :many
SELECT * FROM sync_queue
WHERE status = 'pending'
ORDER BY created_at ASC;
-- name: ListPendingSyncItemsByLocation :many
SELECT * FROM sync_queue
WHERE storage_location_id = $1 AND status = 'pending'
ORDER BY created_at ASC;
-- name: UpdateSyncQueueStatus :exec
UPDATE sync_queue
SET status = $1, attempts = $2, updated_at = CURRENT_TIMESTAMP
WHERE id = $3;
-- name: DeleteSyncQueueItem :exec
DELETE FROM sync_queue
WHERE id = $1;