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:
2026-11-24 13:54:45 -05:00
co-authored by Claude Opus 5.5
parent 38d138a759
commit 3f0980a815
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -485,7 +485,10 @@ type UpsertArtistParams struct {
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.
func (q *Queries) UpsertArtist(ctx context.Context, arg UpsertArtistParams) (Artist, error) {
row := q.db.QueryRow(ctx, upsertArtist, arg.Name, arg.SortName, arg.Mbid)
+4 -1
View File
@@ -1,5 +1,8 @@
-- 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.
INSERT INTO artists (name, sort_name, mbid)
VALUES ($1, $2, $3)