upper / db

Data Access Layer (DAL) for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.
https://upper.io/
MIT License
3.54k stars 235 forks source link

consider pgx for future postgresql driver #621

Open pkieltyka opened 3 years ago

pkieltyka commented 3 years ago

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?

arigon commented 3 years ago

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.

pkieltyka commented 3 years ago

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

arigon commented 3 years ago

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.

xiam commented 3 years ago

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