Photo cache and /media endpoint (#68)
CI / ci (push) Successful in 1m38s

Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
This commit was merged in pull request #68.
This commit is contained in:
2026-10-05 14:24:11 -04:00
committed by approver_agent
parent 2fb7807af3
commit 58e8f30f0e
18 changed files with 1054 additions and 25 deletions
+22
View File
@@ -59,6 +59,28 @@ func (q *Queries) CreatePhoto(ctx context.Context, arg CreatePhotoParams) (Photo
return i, err
}
const getPhoto = `-- name: GetPhoto :one
SELECT id, source_url, local_path, width, height, sha256, fetched_at, created_at, updated_at FROM photos
WHERE id = ?
`
func (q *Queries) GetPhoto(ctx context.Context, id string) (Photo, error) {
row := q.db.QueryRowContext(ctx, getPhoto, id)
var i Photo
err := row.Scan(
&i.ID,
&i.SourceUrl,
&i.LocalPath,
&i.Width,
&i.Height,
&i.Sha256,
&i.FetchedAt,
&i.CreatedAt,
&i.UpdatedAt,
)
return i, err
}
const getPhotoBySHA256 = `-- name: GetPhotoBySHA256 :one
SELECT id, source_url, local_path, width, height, sha256, fetched_at, created_at, updated_at FROM photos
WHERE sha256 = ?