-
-
Notifications
You must be signed in to change notification settings - Fork 169
Description
Hello,
I have started using the library for a pet project of mine and I am really excited about it. It removes a lot of the boilerplate that I need to write for anything related to databases. However, I had some issues when I tried to unit test some my code.
To be more precise, I use the qrm.DB interface to pass it to any Query made from jet and mock it for the unit tests, but I couldn't find a way to mok it work properly. When jet calls Query it's seems that internally calls the QueryContext method of the DB interface which has the following signature QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error).
It may either return a sql.Rows pointer or an err, but sql.Rows is a struct that doesn't expose any of its internal fields and I cannot pass anyting else except a nil pointer, which makes QueryContext to panic and propagates to jet Query method.
Can you suggest a solution or an alternative solution to this issue?