pashagolub / pgxmock

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

Add support for `ConnInfo` #85

Closed jsnb-devoted closed 2 years ago

jsnb-devoted commented 2 years ago

Is your feature request related to a problem? Please describe. We are developing an app that uses ConnInfo method in pgx (link). We have our own interface for mocking but we want to move to pgxmock the issue I'm running into now is that our interface isn't compatible because the pgxIface is missing the ConnInfo method:

cannot use mock (variable of type pgxmock.PgxConnIface) as DBConn value in argument to getAllTables: pgxmock.PgxConnIface does not implement DBConn (missing method ConnInfo)

Describe the solution you'd like Add the ConnInfo method to the interface if that is sensible/backwards compatible.

Describe alternatives you've considered We are effectively doing the alternative by having our own interface but we are missing all the great unit testing functionality in pgxmock that we would like to use.

Additional context I'll submit a naive PR for this. I suspect adding this could cause issues for current users of the package. I'm newer to go package development.