23 lines
444 B
Go
23 lines
444 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
db "zardzul/music-index/sqlc"
|
|
)
|
|
|
|
type ArtistRepository interface {
|
|
GetAll(ctx context.Context) ([]db.Artist, error)
|
|
}
|
|
|
|
type SQLCArtistRepository struct {
|
|
q *db.Queries
|
|
}
|
|
|
|
func NewArtistRepository(queries *db.Queries) *SQLCArtistRepository {
|
|
return &SQLCArtistRepository{q: queries}
|
|
}
|
|
|
|
func (r *SQLCArtistRepository) GetAll(ctx context.Context) ([]db.Artist, error) {
|
|
return r.q.GetAllArtists(ctx)
|
|
}
|