Skip to content

Using sqlx and pgx in a project #1530

Answered by jackc
barbinimichael asked this question in Q&A
Discussion options

You must be logged in to vote

sqlx requires database/sql so you will have to use the pgx/v5/stdlib package. There's nothing preventing you from establishing native pgx pools or connections at the same time as database/sql.

But it would probably be simpler to use database/sql and acquire a pgx connection from it when you need PostgreSQL functionality such as COPY FROM. See the package docs for stdlib for an example.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by barbinimichael
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants