Open CodeBardian opened 1 month ago
I have a pg_service.conf (https://www.postgresql.org/docs/current/libpq-pgservice.html) that holds all required connection parameters.
[mydb] host=localhost port=5432 user=postgres password=test
I can successfully connect with psycopg2 (or sqlalchemy) using psycopg2.connect("postgresql://?service=mydb")
psycopg2.connect("postgresql://?service=mydb")
Using await asyncpg.connect("postgresql://?service=mydb") however always fails with
await asyncpg.connect("postgresql://?service=mydb")
asyncpg.exceptions.ConnectionDoesNotExistError: connection was closed in the middle of operation
Also when using the same connection string in sqlachemy with asyncpg dialect, the connection call is converted to
await asyncpg.connect(service='mydb'), which also fails: connect() got an unexpected keyword argument 'service'
await asyncpg.connect(service='mydb')
connect() got an unexpected keyword argument 'service'
So therefore my general question, whether there is support for this type of connection in asyncpg?
I have a pg_service.conf (https://www.postgresql.org/docs/current/libpq-pgservice.html) that holds all required connection parameters.
I can successfully connect with psycopg2 (or sqlalchemy) using
psycopg2.connect("postgresql://?service=mydb")
Using
await asyncpg.connect("postgresql://?service=mydb")
however always fails withAlso when using the same connection string in sqlachemy with asyncpg dialect, the connection call is converted to
await asyncpg.connect(service='mydb')
, which also fails:connect() got an unexpected keyword argument 'service'
So therefore my general question, whether there is support for this type of connection in asyncpg?