allow URL-unsafe characters inside raw JDBC connection-uri
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!
What happens when the password is percent-encoded? In theory JDBC should be decoding any percent-encoded passwords.
Received an error because of AUTHENTICATION FAILED and so on. Didn't dig a lot deeper though.
What database are you using?
Actually calling (map->SqlDatabase {:connection-uri url}) with the url containing the unencoded % worked just fine.
PostgreSQL
Which version of Postgres?
9.3.3 and driver [postgresql "9.1-901-1.jdbc4"]
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?
Yeah, we just changed the password :see_no_evil: so we can use lein ragtime migrate during deployments.
Thanks!