Skip to content

Commit

Permalink
feat(db): update client
Browse files Browse the repository at this point in the history
  • Loading branch information
ArielHAlba committed Jul 14, 2022
1 parent 93abcec commit 55d750d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sql/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ import (
)

type DBService struct {
db *sql.DB
API
DB *sql.DB
}

type API interface {
Select(interface{}, string, ...interface{}) error
}

func (db *DBService) Select(dest interface{}, query string, args ...interface{}) error {
return Select(db.db, dest, query, args...)
return Select(db.DB, dest, query, args...)
}

func New(url string) (*DBService, error) {
Expand All @@ -27,7 +26,7 @@ func New(url string) (*DBService, error) {
if err := db.Ping(); err != nil {
return nil, err
}
return &DBService{db: db}, nil
return &DBService{DB: db}, nil
}

func MustNew(url string) *DBService {
Expand Down

0 comments on commit 55d750d

Please sign in to comment.