k1LoW / tbls

tbls is a CI-Friendly tool for document a database, written in Go.
MIT License
3.48k stars 168 forks source link

Bug: tbls thinks password is port if password contains # (hash) in it #348

Closed kpldvnpne closed 2 years ago

kpldvnpne commented 2 years ago

What happened

When I try to do:

tbls doc postgres://user:pass#word@host:5432/dbname

tbls seems to think that user is host and pass is port. Then, it fails saying pass is not a valid port.

What you expected to happened

I expected it to treat user as user and pass#word as password. And then I expected it to create the document properly.

What stack trace or error message from tbls did you see?

parse "postgres://user:pass": invalid port ":pass" after host

Anything else we need to know?

No

Environment

k1LoW commented 2 years ago

Hi.

If you are using a symbol such as # < in database password, URL-encode the password.

ref: https://github.com/k1LoW/tbls#document-a-database

kpldvnpne commented 2 years ago

Thanks. Stupid of me to not notice it in the README. I will close the thread

k1LoW commented 2 years ago

Thanks for using tbls!