Add initial database setup and user/artist management functionality
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user