You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although the SQL panel has code to record procedure calls in the NormalCursorWrapper, there is no code to record function calls, e.g. cursor.callfunc. I also don't see any tests for callproc.
I'd like to contribute tests for callproc, and a wrapper implementation for callfunc that works and is tested, but I need some orientation - where is the SQL schema for tests? Is there anyway to use a "mock" database backend to implement this?
Thanks for any help...
The text was updated successfully, but these errors were encountered:
So, now that I understand the design of the tests a bit better, my plan is to write a sub-class of the sqlite3 backend, which will handle mocking of callproc and callfunc, and allow these to be unit tested without a reliance on mock or unittest.mock.
I'm going to structure this as two pull requests - the first will implement callfunc, and I'll test it with an custom built Django app that integrates django-debug-toolbar.
I still want them to show up, but I am no longer needing to "fix" django-debug-toolbar. I will tell our developers that the best practice is to use cursor.execute('SELECT funcname(...) FROM DUAL', params_dict) instead.
A test backend could be made that converts a callfunc() into a particular select, and a callproc() into a particular update. That way, we can see how they show up. But unless sqlparse supports these, it is hard to see how to proceed.
Although the SQL panel has code to record procedure calls in the
NormalCursorWrapper
, there is no code to record function calls, e.g.cursor.callfunc
. I also don't see any tests forcallproc
.I'd like to contribute tests for
callproc
, and a wrapper implementation forcallfunc
that works and is tested, but I need some orientation - where is the SQL schema for tests? Is there anyway to use a "mock" database backend to implement this?Thanks for any help...
The text was updated successfully, but these errors were encountered: