Use uuid.UUID everywhere and have postgres generate ids
This commit is contained in:
@ -2,19 +2,12 @@ package postgres
|
||||
|
||||
// Repository represents a PostgreSQL implementation of all ModelServices
|
||||
type Repository struct {
|
||||
DB *Queries
|
||||
IDGenerator *UlidGenerator
|
||||
DB *Queries
|
||||
}
|
||||
|
||||
func NewRepository(queries *Queries) (*Repository, error) {
|
||||
id, err := NewGenerator()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
repo := &Repository{
|
||||
DB: queries,
|
||||
IDGenerator: id,
|
||||
DB: queries,
|
||||
}
|
||||
return repo, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user