-
Notifications
You must be signed in to change notification settings - Fork 2.3k
DSN: support / in database name #1483
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
Comments
I'm open, but please don't assume I will merge it. |
Do you feel that the current test cases are sufficient to cover edge cases and backwards compatibility? |
I don't know. |
@derekperkins Have you tried filling a Here is a template: https://go.dev/play/p/8E3WFHsTTJc |
@dolmen I'm not using this driver directly, I'm configuring the backing grafana database. That being said, I've been using the single url option, so maybe setting the individual fields will have a better outcome https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#url |
@derekperkins |
Our README says:
... but v1.8.0 is not yet released. This is commit d3e4fe6 from #1432. So the issue is fixed, but not released yet. |
Looks like Grafana does a url parse Then fmt it into a go-sql-driver compatible DSN I also checked with https://github.com/xo/usql, which uses https://github.com/xo/dburl to parse the agnostic string, and it returned the same error from go-sql-driver. I can test it out directly to see if it works going straight through the driver |
Issue description
I use Vitess as a sharded MySQL instance. To connect to a specific shard of the database, the syntax expects
dbname/shardname
in the DSN, which looks something like thisI'm able to successfully use this style of DSN in other language drivers - specifically Python via mycli.
Someone brought up a similar issue in #1193 that was closed. I can see in the parsing code that it relies on finding the last slash
https://github.com/zihengCat/mysql/blob/18e71cd4a02b285470363e0f4ddbe58b549230a7/dsn.go#L295-L297
Would you be open to a PR that supported a slash in the db name?
Related issue:
The text was updated successfully, but these errors were encountered: