NewConnector returns new driver.Connector.
(cfg *Config)
| 99 | |
| 100 | // NewConnector returns new driver.Connector. |
| 101 | func NewConnector(cfg *Config) (driver.Connector, error) { |
| 102 | cfg = cfg.Clone() |
| 103 | // normalize the contents of cfg so calls to NewConnector have the same |
| 104 | // behavior as MySQLDriver.OpenConnector |
| 105 | if err := cfg.normalize(); err != nil { |
| 106 | return nil, err |
| 107 | } |
| 108 | return newConnector(cfg), nil |
| 109 | } |
| 110 | |
| 111 | // OpenConnector implements driver.DriverContext. |
| 112 | func (d MySQLDriver) OpenConnector(dsn string) (driver.Connector, error) { |