jackc / pgx

PostgreSQL driver and toolkit for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scan to struct does not working

marvinlnnx opened this issue · comments

I have followed the documentation on go.dev to see how to implement scan to struct, I followed the same instruction provided in the example it is not working, Here
I am using this version:

"github.com/jackc/pgx/v5"

I have also tried, pgxpool , it is also not working, check this screenshot:

image

It should be pgx.RowToStructByName[MyBundle] -- square braces instead of parentheses.

Thank you it works !

so should I use pgxpool or pgx only ?

pgx.RowToStructByName should work with both pgxpool or pgx.