Also return sql.DB to be able to use goose

This commit is contained in:
2021-12-02 20:36:22 +00:00
parent a3df95a700
commit 4011f3cace
3 changed files with 14 additions and 15 deletions

View File

@ -18,12 +18,12 @@ func main() {
bv := &bcrypt.Verifier{}
db, err := postgres.Connect(cfg.DatabaseHost, cfg.DatabaseUser, cfg.DatabasePassword, cfg.DatabaseName)
q, db, err := postgres.Connect(cfg.DatabaseHost, cfg.DatabaseUser, cfg.DatabasePassword, cfg.DatabaseName)
if err != nil {
log.Fatalf("Failed connecting to DB: %v", err)
}
us, err := postgres.NewRepository(db)
us, err := postgres.NewRepository(q, db)
if err != nil {
log.Fatalf("Failed building Repository: %v", err)
}