2020-07-05 01:02:57 +02:00
|
|
|
package db
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/jmoiron/sqlx"
|
|
|
|
)
|
|
|
|
|
2020-08-21 01:11:24 +02:00
|
|
|
// Repository contains methods for interacting with a database storage
|
2020-07-05 01:02:57 +02:00
|
|
|
type Repository struct {
|
|
|
|
*Queries
|
|
|
|
db *sqlx.DB
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewRepository returns an implementation of the Repository interface.
|
|
|
|
func NewRepository(db *sqlx.DB) *Repository {
|
|
|
|
return &Repository{
|
|
|
|
Queries: New(db.DB),
|
|
|
|
db: db,
|
|
|
|
}
|
|
|
|
}
|