-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skipping Cache Invalidations for Unsupported Raw Queries #248
base: master
Are you sure you want to change the base?
Skipping Cache Invalidations for Unsupported Raw Queries #248
Conversation
Thanks! Please add a test for this to catch the warning. |
Pull Request Test Coverage Report for Build 6688981804
💛 - Coveralls |
3c0fa5d
to
578bf81
Compare
thank you! |
ci is failing |
is there any decorator that I can use to specify test case for a specifc DB only say postgres, cause in this case only postgres support pycopg objects other's don't! |
Hi I didn't notice that. You need to support all databases in this case, so I would just write it as plain SQL. |
@git-yogeshkumar I suggest you can use see django-cachalot/cachalot/tests/postgres.py Lines 55 to 58 in 6df9704
|
This is for issue #246
//: # (What're you proposing?)
I am raising a warning if the user is using Raw queries other than direct strings like psycopg2 Compose Objects for execution with cursor, I believe cachalot should not break if such cases are encountered, it should just not invalidate the cache if this happens and let the query execute.
Rationale
Since, raw queries can be executed using multiple formats, we should give users warning and don't raise unhandled exception as it causes unknown issues in running program.