-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PostgreSQL and not using lib/pq for arrays #2960
Open
Description
What do you want to change?
Current state
In current state of the library, using queries with arrays generates code with a dependency to github.com/lib/pq, which is in maintenance mode.
Example from the docs:
func (q *Queries) ListAuthorsByIDs(ctx context.Context, ids []int) ([]Author, error) { rows, err := q.db.QueryContext(ctx, listAuthors, pq.Array(ids))
It would be great if it was possible to not have pq dependency here.
Implications
This might lead to some misleading situations, example:
The pgx lib, which is used often as a replacement for lib/pq, is possible to use in such way:
db, err := sql.Open("pgx", os.Getenv("DATABASE_URL"))
This means that if you use sqlc in the default database/sql mode with such command, you end up with:
- imported
pqdependency - but actually you're using
pgxas a driver
Thank you in advance for looking into this issue.
What database engines need to be changed?
PostgreSQL
What programming language backends need to be changed?
Go