Skip to content

DSN: support / in database name #1483

Closed
@derekperkins

Description

@derekperkins

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 this

mysql://username:password@host:1234/dbname/0?interpolateParams=true

I'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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions