Wrangler errors if my Hyperdrive > `connectionString` contains an apostrophe

My DB password contains ', and therefore so does my local connection string for working with Hyperdrive during development. This leads to the attached error when running locally - but not if I run with the --remote flag. Is this a bug? In my TOML, the connection string is specified within ", so the value should be able to accommodate '.
No description
8 Replies
kian
kian12mo ago
Is ' the only special character in the password? I would expect /, ? and # to be issues in the password field - not '.
Mitya
MityaOP12mo ago
My apologies - there is indeed a ? in there too. Not sure why I lazily assumed it would be the apostrophe. I can of course change the password, but it's good to know which characters cause issues. Thank you!
kian
kian12mo ago
You could probably also percent encode it - Postgres is fine with that.
Mitya
MityaOP12mo ago
Aha - good shout. Thanks!
DaniFoldi
DaniFoldi12mo ago
For completeness, there is a PR open that will perform this encoding for you automatically: https://github.com/cloudflare/workers-sdk/pull/4419
kian
kian12mo ago
It looks like the PR wouldn't actually solve the problem that Mitya had in that case meowthinking is just decoding a percent-encoded URL, but the issue that Mitya had is that it'll fail at new URL() anyways unless you manually percent-encode it yourself. I guess the actual separate issue here is to make a better callout to what the issue is (characters in the password that need percent-encoding)
Want results from more Discord servers?
Add your server