sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Add support for COPY command in bulk inserts with lib/pq driver

Open giulianopz opened this issue 1 year ago • 1 comments

What do you want to change?

At the moment, the documentation states:

PostgreSQL supports the COPY protocol that can insert rows a lot faster than sequential inserts. [...] The :copyfrom command requires either pgx/v4 or pgx/v5.

Please, add support for bulk inserts also with lib/pq by means of a COPY instruction as originally requested by the issue #218 opened by @kyleconroy.

What database engines need to be changed?

PostgreSQL

What programming language backends need to be changed?

Go

giulianopz avatar Mar 11 '24 21:03 giulianopz

I'm not sure how much work this feature would take in sqlc, but it may not be worth it. Users of lib/pq would be better served by moving away from it given that it's semi-unmaintained. From its readme:

For users that require new features or reliable resolution of reported bugs, we recommend using pgx which is under active development.

bgentry avatar Sep 10 '24 15:09 bgentry