Use goose for migrations
This commit is contained in:
@ -1,11 +1,20 @@
|
||||
package postgres
|
||||
|
||||
import (
|
||||
"git.javil.eu/jacob1123/budgeteer"
|
||||
)
|
||||
|
||||
// Repository represents a PostgreSQL implementation of all ModelServices
|
||||
type Repository struct {
|
||||
DB *Queries
|
||||
IDGenerator budgeteer.IDGenerator
|
||||
IDGenerator *UlidGenerator
|
||||
}
|
||||
|
||||
func NewRepository(queries *Queries) (*Repository, error) {
|
||||
id, err := NewGenerator()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
repo := &Repository{
|
||||
DB: queries,
|
||||
IDGenerator: id,
|
||||
}
|
||||
return repo, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user