-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DialFunc needs a timeout parameter #250
Comments
Sorry for replying late. Just set the timeout parameter yourself in the Dialfunc. If that's not possible, please tell us why. |
For the same reason you provide an address parameter. A DialFunc is registered once for a given network type, but it's used to create multiple connections. Those connections may have different addresses and different timeouts. |
The In case we modify the |
A |
If we do so, there's a potential synergy with #224. Assuming type Dsn struct {
User string
Password string
Protocol string
Address string
Schema string
// enforce and clarify that every parameter only appears once and is position independent
Params map[string]string
} We just move the logic in |
I understand this is not a trivial issue to fix, but what are we going to do with it? Personally I feel my proposed patch would be a good compromise for now, while we ponder some more on the desired solution for how we handle some of the magic that's been currently implemented. Edit: I think this should have been posted as part of #346 not this thread... |
Go 1.8 adds Context support to database/sql. |
It doesn't change this issue. Context support is being added for database operations such as Exec and Prepare. The timeout parameter determines how long to try opening a connection to the backend (i.e. Driver.Open), and there still won't be a context on that. |
I implemented the They solves this issue, doesn't them? |
DialContext is supported now. |
The DSN contains a timeout parameter that is passed to the standard net.Dialer. Please provide this to custom dialers as well.
The text was updated successfully, but these errors were encountered: