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,21 @@
-- name: CreateResourceVariant :one
INSERT INTO resource_variants (resource_id, variant_type, page_number, width, height, mime_type, generated_by, storage_key)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
RETURNING *;
-- name: GetVariantsByResourceID :many
SELECT * FROM resource_variants
WHERE resource_id = $1
ORDER BY page_number ASC, variant_type ASC;
-- name: GetVariantByID :one
SELECT * FROM resource_variants
WHERE id = $1 LIMIT 1;
-- name: DeleteVariantsByResourceID :exec
DELETE FROM resource_variants WHERE resource_id = $1;
-- name: GetBestVariant :one
SELECT * FROM resource_variants
WHERE resource_id = $1 AND variant_type = $2 AND page_number = 1
LIMIT 1;