Closed sv-22 closed 3 weeks ago
Nevermind, I've figured out that it can be done like this
dbScanApi, err := pgxscan.NewDBScanAPI(dbscan.WithAllowUnknownColumns(true))
if err != nil {
return err
}
api, err := pgxscan.NewAPI(dbScanApi)
if err != nil {
return err
}
err = api.Select(t.context, querier, dest, sqlString, args...)
I thought pgxscan would accept dbscan options directly, instead it expects a dbscan API.
NewApi and its options do not appear to work with pgxscan, only dbscan which would be ok if dbscan accepted pgx rows, but it doesn't. Which means we can't use any of the NewApi options like WithAllowUnknownColumns.
We are using pgx V5 and scany V2
Please confirm if it's intended behaviour, is it just lacking implementation or is it a bug?
Thanks.