Add initial database setup and user/artist management functionality
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.30.0
|
||||
// source: user_albums.sql
|
||||
|
||||
package sqlc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
const updateUserAlbumStatus = `-- name: UpdateUserAlbumStatus :exec
|
||||
INSERT INTO user_albums (user_id, album_id, album_owned, album_want,
|
||||
is_vinyl, is_cd) VALUES ($1, $2, $3, $4, $5, $6)
|
||||
ON CONFLICT (user_id, album_id) DO UPDATE SET
|
||||
album_owned = EXCLUDED.album_owned,
|
||||
album_want = EXCLUDED.album_want,
|
||||
is_vinyl = EXCLUDED.is_vinyl,
|
||||
is_cd = EXCLUDED.is_cd
|
||||
`
|
||||
|
||||
type UpdateUserAlbumStatusParams struct {
|
||||
UserID pgtype.UUID `json:"user_id"`
|
||||
AlbumID pgtype.UUID `json:"album_id"`
|
||||
AlbumOwned bool `json:"album_owned"`
|
||||
AlbumWant bool `json:"album_want"`
|
||||
IsVinyl bool `json:"is_vinyl"`
|
||||
IsCd bool `json:"is_cd"`
|
||||
}
|
||||
|
||||
// user_albums.sql
|
||||
func (q *Queries) UpdateUserAlbumStatus(ctx context.Context, arg UpdateUserAlbumStatusParams) error {
|
||||
_, err := q.db.Exec(ctx, updateUserAlbumStatus,
|
||||
arg.UserID,
|
||||
arg.AlbumID,
|
||||
arg.AlbumOwned,
|
||||
arg.AlbumWant,
|
||||
arg.IsVinyl,
|
||||
arg.IsCd,
|
||||
)
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user