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 URL-unsafe characters inside raw JDBC connection-uri #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gerrit-hntschl
Copy link

ragtime.core/connection tries to parse the raw-connection-string as a URI which fails if the string contains unsafe characters like %.
Our password contained such characters which lead to java.net.URISyntaxException: Malformed escape pair ... when trying to run lein ragtime migrate.
Not sure if proposed fix is a hack, otherwise unsafe characters would have to be percent-encoded inside the project.clj/profiles.clj and parsed inside ragtime, which only adds confusion IMHO.

Cheers!

@weavejester
Copy link
Owner

What happens when the password is percent-encoded? In theory JDBC should be decoding any percent-encoded passwords.

@gerrit-hntschl
Copy link
Author

Received an error because of AUTHENTICATION FAILED and so on. Didn't dig a lot deeper though.

@weavejester
Copy link
Owner

What database are you using?

@gerrit-hntschl
Copy link
Author

Actually calling (map->SqlDatabase {:connection-uri url}) with the url containing the unencoded % worked just fine.

@gerrit-hntschl
Copy link
Author

PostgreSQL

@weavejester
Copy link
Owner

Which version of Postgres?

@gerrit-hntschl
Copy link
Author

9.3.3 and driver [postgresql "9.1-901-1.jdbc4"]

@weavejester
Copy link
Owner

Okay, I'll run some tests when I get a spare minute. I want to ensure that Postgres really does handle URLs incorrectly before adding any hacks to get around this.

In the meantime, you can use map->SqlDatabase, correct?

@gerrit-hntschl
Copy link
Author

Yeah, we just changed the password 🙈 so we can use lein ragtime migrate during deployments.

Thanks!

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.

2 participants