-
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
ParseDSN doesn't support usernames containing colons #591
Comments
may I suggest use also, use url compliant dsn scheme would be great, and save a lot dsn related parsing / formating code. for example |
😟 I just checked the docs and then tried with the commandline client:
Apparently that's valid. We have lots and lots of old code using the existing DSN and we must not break it. To support that kind of username, we have to signal that a new kind of DSN is used.
The options as I see them:
@julienschmidt @methane what do you think? |
@csyangchen if we would start from scratch, we would certainly choose to use just a standard conforming URL as DSN. So @arnehormann, I would go with option number 2 or 3 (in now more than 5 years this driver exists, nobody ever complained about it until now). In case of number 2, I would however go with something semantically more meaningful than "mysql2" and then use the url package to parse the DSN string. |
let's go with wontfix, then. Adding a different Open identifier is its own can of worms... |
So not a problem in 5 years and now 2 problems in less than 6 months. Any consideration to the other options? I hate to maintain a fork. |
Starting with Go 1.10 there will be an alternative way to open connections using a See also #671 |
We should at least document the current situation and propose workarounds. |
Waiting until Go 1.10 seems like a good compromise. Documentation would be great. I spent a lot of time pulling out hair. I already implement my own driver that does some preliminary lookups against our service discovery system, so mysql DSNs are never interacted with directly. |
In fact if Connector interface were to be implemented i could use it directly today even on older versions of go since I already create my own Driver and just wrap it? I guess the concerns could be that the interface signature could change before the 1.10 freeze, but that is pretty low. |
Issue description
ParseDSN unspoport ":" in username
Example code
The text was updated successfully, but these errors were encountered: