Allow dialers and TLS configuration to be added directly to MySQLDriver type
I would like to be able to create MySQL connections with custom TLS configuration and dialers without modifying the package-global registries, especially now that Go 1.10's OpenDB function is available. If the same register functions were available as methods on the driver and modifying a particular driver's state, that would go a long way.
Happy to send a PR to fix.
ref: #705
Ah, I see. Seems like that PR would be closer to what I want, but IIUC the Connector would still depend on package variables. It would be nice to have Connector just take the dialer function or TLS config directly, instead of going through the string indirection.
Ran into this today. Glad to see driver.Connector implemented, but TLS config is not possible without doing parseDSN since cfg.tls is not exported and is only added via ParseDSN
+1, would love to see ability to create a driver.Connector from a net.Conn.
The caller can set up tls if necessary.
I dislike registry APIs, and I want to add this too.
But before adding this, we need to decide what should we do for Config.FormatDSN() It doesn't return error for now.
What should do we do when the config is not representable by a DSN?