taskcafe/internal/db/repository.go

18 lines
334 B
Go
Raw Normal View History

package db
2022-05-06 23:41:52 +02:00
import "database/sql"
// Repository contains methods for interacting with a database storage
type Repository struct {
*Queries
2022-05-06 23:41:52 +02:00
db *sql.DB
}
// NewRepository returns an implementation of the Repository interface.
2022-05-06 23:41:52 +02:00
func NewRepository(db *sql.DB) *Repository {
return &Repository{
2022-05-06 23:41:52 +02:00
Queries: New(db),
db: db,
}
}