sqlc-dev / sqlc

Generate type-safe code from SQL
https://sqlc.dev
MIT License
13.58k stars 812 forks source link

WithTx should accept a DBTX interface instance, not a concrete *sql.Tx or pgx.Tx for Go. #3603

Open urandom opened 2 months ago

urandom commented 2 months ago

What do you want to change?

Currently, when the WithTx method is generated, it accepts a concrete type: either an *sql.Tx or a pgx.Tx. However, the arguments ends up being assigned to a DBTX-typed field. The argument then should also be of type DBTX

What database engines need to be changed?

PostgreSQL

What programming language backends need to be changed?

Go