Closed quanqqqqq closed 11 months ago
I think that we need
var ( oracleDriver = &OracleDriver{cusTyp: map[string]customType{}} )
func init() { sql.Register("oracle", oracleDriver) }
func GetDefaultDriver() *OracleDriver { return oracleDriver }
ok I will fix in next release and inform you
@sijms hello, what's time fix this issue?
sorry I was so busy last week I will release today or tomorrow
v2.7.18
add 2 function NewDriver
and NewConnector
. (also update readme file)
so you can do as follow:
// New connector will create new driver (not use default driver)
// so you can connect to multiple database each one has its own driver
connector, err := go_ora.NewConnector(connStr)
if err != nil {
log.Fatal(err)
}
// set custom dialer
connector.Dialer(newDialer)
// Get a database handle.
db = sql.OpenDB(connector)
i want to inject dialer through this code,but OracleDriver will panic,because
cusTyp
is nilcan fix by this code? then I can init with NewOracleDriver()