docs(db): UpsertArtist matches on mbid only; the comment said name too
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -485,7 +485,10 @@ type UpsertArtistParams struct {
|
|||||||
Mbid *string
|
Mbid *string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert or update by mbid when present; otherwise by (name, sort_name).
|
// Inserts an artist, or updates the row that already has this mbid. Only
|
||||||
|
// the mbid is matched: called without one, it inserts a new row every time,
|
||||||
|
// so a caller that may meet the same artist again looks it up by name first
|
||||||
|
// (the scanner's resolveArtist does).
|
||||||
// Callers pass the canonical sort_name; scanner is responsible for derivation.
|
// Callers pass the canonical sort_name; scanner is responsible for derivation.
|
||||||
func (q *Queries) UpsertArtist(ctx context.Context, arg UpsertArtistParams) (Artist, error) {
|
func (q *Queries) UpsertArtist(ctx context.Context, arg UpsertArtistParams) (Artist, error) {
|
||||||
row := q.db.QueryRow(ctx, upsertArtist, arg.Name, arg.SortName, arg.Mbid)
|
row := q.db.QueryRow(ctx, upsertArtist, arg.Name, arg.SortName, arg.Mbid)
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
-- name: UpsertArtist :one
|
-- name: UpsertArtist :one
|
||||||
-- Insert or update by mbid when present; otherwise by (name, sort_name).
|
-- Inserts an artist, or updates the row that already has this mbid. Only
|
||||||
|
-- the mbid is matched: called without one, it inserts a new row every time,
|
||||||
|
-- so a caller that may meet the same artist again looks it up by name first
|
||||||
|
-- (the scanner's resolveArtist does).
|
||||||
-- Callers pass the canonical sort_name; scanner is responsible for derivation.
|
-- Callers pass the canonical sort_name; scanner is responsible for derivation.
|
||||||
INSERT INTO artists (name, sort_name, mbid)
|
INSERT INTO artists (name, sort_name, mbid)
|
||||||
VALUES ($1, $2, $3)
|
VALUES ($1, $2, $3)
|
||||||
|
|||||||
Reference in New Issue
Block a user