sqlx
sqlx copied to clipboard
sqlx problem with passwords containing special chars and % encoding
Bug Description
It looks like Postgres support has issues with special character passwords even when using %encoding.
Minimal Reproduction
Try to connect to PSQL with following URI ( no special chars escaping)
DB URL: postgres://sys_d:/7M+r?E':[email protected]/dbkn
Result:
WARN sqlx_postgres::options::parse: ignoring unrecognized connect parameter key=E':[email protected]/dbkn value=
Error: error communicating with database: failed to lookup address information: Name or service not known
So "?" is a problem. Escaping with %3F doesn't help:
DB URL: postgres://sys_d:/7M+r%3FE':[email protected]/dbkn
Result:
Error: error communicating with database: failed to lookup address information: Name or service not known
Info
- SQLx version: 0.7.4
- SQLx features enabled: ["sqlx-postgres", "runtime-tokio", "tls-rustls", "postgres"]
- Database server and version:/ Postgres
- Operating system: Linux
-
rustc --version: rustc 1.78.0 (9b00956e5 2024-04-29)
Try doing a full escape of that password, it should be %2F7M%2Br%3FE%27%3AdHz
It uses regular url encoding with you can find online converts for it
Closing as user error.