stripe / pg-schema-diff

Go library for diffing Postgres schemas and generating SQL migrations
MIT License
334 stars 24 forks source link

mask password for dsn #160

Closed bheemvennapureddy closed 3 weeks ago

bheemvennapureddy commented 3 weeks ago

mask password in the plan log when logging to the console.

Navbryce commented 3 weeks ago

If you want to mask the password, you should use PGPASSWORD env var like you would for psql, and exclude it from your connection string. This also ensures your command history doesn't log thr password.

This is the same behavior as psql and any libpq-based tool, https://www.postgresql.org/docs/current/libpq-envars.html

bheemvennapureddy commented 3 weeks ago

that works

bheemvennapureddy commented 3 weeks ago

I run into hba conf issues without passing the password in the connection string any insights you can share ?

Navbryce commented 3 weeks ago

I recommend debugging via psql and then emulating that in pg-schema-diff. If you find a discrepancy between the two, let me know. Not to sure exactly what is causing your issue.

bheemvennapureddy commented 3 weeks ago

I had to export export PGSSLMODE=require as well for that.