the rest
This commit is contained in:
19
internal/db/queries/gallery_photos.sql
Normal file
19
internal/db/queries/gallery_photos.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- name: ListGalleryPhotos :many
|
||||
SELECT id, image_url, caption, created_at, show_on_home
|
||||
FROM gallery_photos
|
||||
ORDER BY created_at DESC;
|
||||
|
||||
-- name: ListHomeCarouselPhotos :many
|
||||
SELECT id, image_url, caption, created_at, show_on_home
|
||||
FROM gallery_photos
|
||||
WHERE show_on_home = true
|
||||
ORDER BY created_at DESC;
|
||||
|
||||
-- name: CreateGalleryPhoto :one
|
||||
INSERT INTO gallery_photos (image_url, caption, created_at, show_on_home)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
RETURNING id, image_url, caption, created_at, show_on_home;
|
||||
|
||||
-- name: DeleteGalleryPhoto :exec
|
||||
DELETE FROM gallery_photos
|
||||
WHERE id = $1;
|
||||
Reference in New Issue
Block a user