sfu-db / connector-x

Fastest library to load data from DB to DataFrames in Rust and Python
https://sfu-db.github.io/connector-x
MIT License
1.85k stars 146 forks source link

Postgresql: .pgpass support #567

Open hackenspp opened 5 months ago

hackenspp commented 5 months ago

Connectorx does not support passwords stored in the .pgpass (or pgpass.conf in windows). It's useful to avoid to specify it directly in the code or some sort of config file.

aimtsou commented 2 months ago

This can be achieved, I need to think how it can be given from the user that we use postgres in the conn variable. After that we need some OS dependent code to see if pgpass exist and then to see if we read it how it gets passed. I believe it is the rewrite_conn method but I will need to dig deeper.

surister commented 1 week ago

To some level we need to introduce some mechanism to do X depending on the database and the ability to identify the database (by uri.scheme I suppose)

This would also enable features like this to be easily implemented for other databases, on top of checking the

surister commented 1 week ago

@wangxiaoying Can you asign this to @aimtsou