db icon indicating copy to clipboard operation
db copied to clipboard

consider pgx for future postgresql driver

Open pkieltyka opened this issue 3 years ago • 4 comments

This package is effectively in maintenance mode and is not actively developed. Small patches and features are only rarely reviewed and merged. We recommend using pgx which is actively maintained.

mentioned at https://github.com/lib/pq#status


https://github.com/jackc/pgx is better maintained and has improved performance. I've heard about it over many years and it looks quite mature now. As well, it is compatible with database/sql so should be easy for upper to support it as well: https://github.com/jackc/pgx#compatibility-with-databasesql

perhaps for upper v5 we should consider trying it out / switching to it?

pkieltyka avatar Feb 18 '21 18:02 pkieltyka

I ran into a specific pq problem (connect.Open():pq: no pg_hba.conf entry for host) but it works with pgx. So I would also love to see a switch from pq to pgx.

arigon avatar Feb 23 '21 19:02 arigon

@arigon best options are to submit PR, wait or set a bounty for the work for other contributors

pkieltyka avatar Feb 23 '21 19:02 pkieltyka

I have now abandoned this library and completely switched all microservices to jackc/pgx. I had a look into the adapter code of the postgresql adapter but there are way too many dependencies to replace lib/pq by pgx. especially by not only replacing it with the pgx standard database/sql driver but by using connection pools and the more performant features of pgx.

arigon avatar Mar 04 '21 14:03 arigon

Quick update: things are looking good with pgx, a few tests are going to be changed but in general seems like it won't be problematic to adopt it for both PostgreSQL and CockroachDB. WIP: https://github.com/upper/db/pull/627

xiam avatar Mar 22 '21 16:03 xiam