driftprogramming / pgxpoolmock

pgx postgresql pool
MIT License
38 stars 16 forks source link

Rows does not correctly works for QueryRow #8

Open janisz opened 1 year ago

janisz commented 1 year ago

Describe the bug Rows does not correctly works for QueryRow.

To Reproduce

pgxRows := pgxpoolmock.NewRows([]string{"server_version"}).AddRow("15.1").ToPgxRows()
pgxRows.Next() // This line is necessary to prevent panic during Scan.
db.EXPECT().QueryRow(gomock.Any(), "SHOW server_version;").Return(pgxRows)
github.com/driftprogramming/pgxpoolmock.(*rowSets).Scan(0x41ee87?, {0xc000b5e820?, 0x2cac0a0?, 0x3933e01?})
go/pkg/mod/github.com/driftprogramming/pgxpoolmock@v1.1.0/rows.go:69 +0x5f0

Expected behavior Add Row struct that will correctly implement pgx.Row interface.