feat: support driver.DriverContext interface
sql.Open internally makes use of the DriverContext interface, and if a Driver does not implement it, it creates a light wrapper1.
This DriverContext provides better context support as well as providing some useful error checking upfront. For instance, the mysql driver can check the DSN value before opening a connection to see if it's well formed. That way you get an error instantly instead of an error when making your first sql query
1: https://github.com/golang/go/blob/d0dd26a88c019d54f22463daae81e785f5867565/src/database/sql/sql.go#L832 https://github.com/golang/go/blob/d0dd26a88c019d54f22463daae81e785f5867565/src/database/sql/sql.go#L755-L766
Hey @conradludgate thanks for doing this, it looks like a great contribution! Is there any way to test this?
Hey @conradludgate thanks for doing this, it looks like a great contribution! Is there any way to test this?
Sure! I'll look into it later