Skip to content
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

Allow for url encoded dbname in dsn #1388

Closed
wants to merge 1 commit into from

Conversation

lachlanorr
Copy link

  • Support for dbnames containing special characters, in particular '/' which can occur in legacy rails databases (e.g. db/development or db/production)

Description

I've been using this project to connect to some legacy RoR mysql databases. There is a prevalent naming convention in these databases such as 'db/development' or 'db/production'. I tried a few different approaches but couldn't figure out how to use this project with database names that contain '/' characters. In a few places in dsn.go you are using url QueryEscape and QueryUnescape, so I applied the same principal to dbname in cases where there are special characters in the dbname that break the parser.

Checklist

  • [ X ] Code compiles correctly
  • [ X ] Created tests which fail without the change (if possible)
  • [ X ] All tests passing
  • Extended the README / documentation, if necessary
  • [ X ] Added myself / the copyright holder to the AUTHORS file

- Support for dbnames containing special characters, in
  particular '/' which can occur in legacy rails
  databases (e.g. db/development or db/production)
@methane
Copy link
Member

methane commented Jan 25, 2023

Would you explain backward compatibility?
Will any DSN that is valid for current parser be parsed into different config?

@methane
Copy link
Member

methane commented May 25, 2023

Fixed in #1432.

@methane methane closed this May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants