Closed jacobwgillespie closed 4 years ago
I'm not 100% familiar with why this was the way it was before, so I may be missing something, but hopefully this is more robust
Honestly, I can't figure out what would have possessed me to write so much unnecessary (and less correct) code; I'm going to blame it on lack of sleep :yawning_face:
Released in v1.0.1
Hey, it looks like as a side effect of
makeRootDatabaseConnectionString()
passing throughpg-connection-string
is that it fails to preserve some more complex connection string parameters, for instancesslrootcert
. When that option is specified, it actually loads the certificate data, soparsed.ssl
becomes{ca: '...'}
rather thantrue
.This means that when
makeRootDatabaseConnectionString()
converts it back into a connection string, it adds?ssl=%5Bobject%20Object%5D
.This PR switches to use the
url
module to just swap out the pathname, which in theory should be less disruptive than attempting to handle every possible connection parameter, as it preserves the connection URL that the user has provided (as a plus, this removes the// TODO: factor in other connection parameter
). I'm not 100% familiar with why this was the way it was before, so I may be missing something, but hopefully this is more robust.There are two commits in this PR, one to add a failing test, and one to modify
makeRootDatabaseConnectionString()
. I'm opening the PR with only the first so that Travis CI will start a build, then I'll push the 2nd.