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: CreateStorageLocation :one
INSERT INTO storage_locations (user_id, device_name, role)
VALUES ($1, $2, $3)
RETURNING *;
-- name: GetStorageLocation :one
SELECT * FROM storage_locations
WHERE id = $1;
-- name: ListStorageLocationsByUser :many
SELECT * FROM storage_locations
WHERE user_id = $1
ORDER BY created_at ASC;
-- name: GetServerStorageLocation :one
SELECT * FROM storage_locations
WHERE user_id = $1 AND role = 'server'
LIMIT 1;
-- name: UpdateStorageLocationLastSeen :exec
UPDATE storage_locations
SET last_seen_at = CURRENT_TIMESTAMP
WHERE id = $1;
-- name: DeleteStorageLocation :exec
DELETE FROM storage_locations
WHERE id = $1;