go-sql-driver / go-sql-driver/mysql
Move ParseDSN into sub package
Open
organization
- Dominant language
- Go
- Stars
- 15.3k
- Forks
- 2.3k
- Avg merge
- 2h 23m
- Merged PRs (30d)
- 10
Description
### Issue description
Would be good to have ParseDSN/Config struct in another package than mysql since the init function registers the mysql driver, so you can't access it without it registering.
My use case is I wanted to have a simple port check for mysql, obtaining the `Addr` from ParseDSN. Problem is that since it registers the driver, if I subsequently import my utility package it's not easy to see that it's already registered that driver and the app will panic.
### Error log
```
sql: Register called twice for driver mysql
```
Contributor guide
Assessment
This issue has not been assessed yet.