feat(db): add M6a library-list + artist-tracks queries
Appends ListArtistsAlphaWithCovers, ListAlbumsAlphaWithArtist, CountAlbums, and ListArtistTracksForUser queries; regenerates sqlc. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -67,3 +67,16 @@ FROM albums
|
||||
JOIN artists ON artists.id = albums.artist_id
|
||||
ORDER BY albums.created_at DESC, albums.id
|
||||
LIMIT $1;
|
||||
|
||||
-- name: ListAlbumsAlphaWithArtist :many
|
||||
-- M6a: alpha-sorted album list joined with artist_name. Used by
|
||||
-- /api/library/albums for the wrapping-grid page. Stable id-tiebreak.
|
||||
SELECT sqlc.embed(albums), artists.name AS artist_name
|
||||
FROM albums
|
||||
JOIN artists ON artists.id = albums.artist_id
|
||||
ORDER BY albums.sort_title, albums.id
|
||||
LIMIT $1 OFFSET $2;
|
||||
|
||||
-- name: CountAlbums :one
|
||||
-- M6a: total album count for the /api/library/albums envelope.
|
||||
SELECT COUNT(*) FROM albums;
|
||||
|
||||
Reference in New Issue
Block a user