sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

sqlx problem with passwords containing special chars and % encoding

Open MrSpock opened this issue 1 year ago • 1 comments

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)

MrSpock avatar Jul 03 '24 10:07 MrSpock

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

dragonnn avatar Jul 03 '24 11:07 dragonnn

Closing as user error.

abonander avatar Sep 04 '24 02:09 abonander