Expose the registered default driver or a driver.Connector
Could you please consider exposing the package’s registered default *Driver, or (even better) providing a driver.Connector constructor?
Libraries that wrap physical connections currently need to retrieve the private singleton using "hacks" like:
db, _ := sql.Open("sqlite", "")
driver := db.Driver()
db.Close()An API such as sqlite.NewConnector(dsn) or sqlite.DefaultDriver() would avoid this workaround.
Creating a separate
&sqlite.Driver{}is not equivalent because it misses functions, collations, and connection hooks registered on the package-level driver.