Closed krzysztofjeziorny closed 2 years ago
(Closed accidentally.)
I'm not sure if you mean just for looking up passwords, or for reading a full DATABASES
config out of, but either way I think this is probably out of scope for this project. There are some Python packages to read/parse .pgpass
files, but the tricky thing is that .pgpass
files allow for wildcards and multiple entries. We will however support overriding configuration options to make this easier in the (hopefully) near future, i.e. parse("postgresql://user@host/db", PASSWORD=readpgpass())
.
Is there a way to read the
.pgpass
file for the database connection?https://www.postgresql.org/docs/12/libpq-pgpass.html