pashagolub / pgxmock

pgx mock driver for golang to test database interactions
Other
393 stars 49 forks source link

Implements Value() for *rowSets #58

Closed abaruchi closed 2 years ago

abaruchi commented 2 years ago

Is your feature request related to a problem? Please describe. Every time I need to use Values(), I need to override this method which is painful. The current implementation only returns nil, nil. So when I need to use the values, from a row, I have to create a new type and override the method returning a slice with the values.

Describe the solution you'd like An implementation of Value method that allows the user to return a []interface{} with the values of a row.

Describe alternatives you've considered As mentioned, the override is an alternative, but in order to it works, I have to create new types and my test file is huge due to this several changes.

Additional context Currently, the method Values() (https://github.com/pashagolub/pgxmock/blob/master/rows.go#L60) is returning (no matter what) nil,nil. It could return the slice with the row values in it (just as the real pgx4 implementation does).

pashagolub commented 2 years ago

Thanks for your request. I'm on it.

Would you please share how exactly you're using\want to use Values() in your tests?

Thanks in advance

pashagolub commented 2 years ago

Would you be so kind as to give a test for #59

abaruchi commented 2 years ago

Hi @pashagolub thanks for your time and support. I'll test it and give you a feedback.

pashagolub commented 2 years ago

any news on that?

kevinnoel-be commented 2 years ago

@pashagolub I would like to use this feature too, do you have any timeline for a new release containing those changes? Thanks for all!

pashagolub commented 2 years ago

Done. https://github.com/pashagolub/pgxmock/releases/tag/v1.5.0

kevinnoel-be commented 2 years ago

Thanks so much!