Closed
Description
Please modify driver's registration logic.
If I want to work with database/sql package only (which in my opinion is the "better" way) currently I have to add
import _ "github.com/bmizerany/pq"
to trigger pq's init() to call the driver registration on line 33.
I believe that _ imports are in general "bad" as a design decision, and using standard go's lib's sql package is the preferred way to work with sql databases.
At the very least, please put a note in the readme to avoid confusion caused by the lack of (exported) Driver.
Proposed solutions:
- export the driver, remove sql.Register from init()
- add explicit func Register(), remove sql.Register from init()
- leave as is, but document somewhere
Metadata
Metadata
Assignees
Labels
No labels