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
2.02k stars 163 forks source link

Does not seem to use .pgpass file #651

Closed jestover closed 5 months ago

jestover commented 5 months ago

What language are you using?

Python

What version are you using?

Python 3.12.3 connectorx 0.3.3

What database are you using?

PostgreSQL

What dataframe are you using?

Polars

Can you describe your bug?

If I don't include a password that is in my .pgpass file it gives a password missing error

What are the steps to reproduce the behavior?

# Works
import polars as pl
uri = "postgres://username:password@url:port/db_name?sslmode=require"
query = "SELECT * FROM table"
pl.read_database_uri(query=query, uri=uri)

# Doesn't work
import polars as pl
uri = "postgres://username@url:port/db_name?sslmode=require"
query = "SELECT * FROM table"
pl.read_database_uri(query=query, uri=uri)
 # Gives repeated errors like
[2024-06-19T20:06:47Z ERROR r2d2] invalid configuration: password missing

# I can connect using the second uri using sql though, because the .pgpass file contains
# the password.  Not sure if this is a bug or if support for the .pgpass is just not
# implemented
surister commented 5 months ago

Duplicated of #567

wangxiaoying commented 5 months ago

As @surister mention above, please redirect to #567