Skip to content

Commit

Permalink
storage/mariadb: implement TrackStorage.Delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed Mar 25, 2024
1 parent 75445a6 commit 0093087
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions storage/mariadb/track.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,3 +910,17 @@ func (ts TrackStorage) QueueCandidates() ([]radio.TrackID, error) {

return candidates, nil
}

func (ts TrackStorage) Delete(id radio.TrackID) error {
const op errors.Op = "mariadb/TrackStorage.Delete"
handle, deferFn := ts.handle.span(op)
defer deferFn()

var query = `DELETE FROM tracks WHERE id=?`

_, err := handle.Exec(query, id)
if err != nil {
return errors.E(op, err)
}
return nil
}

0 comments on commit 0093087

Please sign in to comment.