denisenkom / go-mssqldb

Microsoft SQL server driver written in go language
BSD 3-Clause "New" or "Revised" License
1.82k stars 499 forks source link

The difference between parameters : connection timeout and dial timeout #744

Open mingkwind opened 2 years ago

mingkwind commented 2 years ago

I test them in my PC. I find that the parameter (dial timeout) is the controller of connection timeout but the parameter (connection timeout) can not control connection timeout. Is there something wrong in the Introduction for the parameter connection timeout?

mingkwind commented 2 years ago

dataSourceName := fmt.Sprintf("sqlserver://%v:%v@%v:%v?database=%v&dial+timeout=%v", service.Username, service.Password, service.Ip, service.Port, "master", timeout) db, err := sql.Open("mssql", dataSourceName)