-
-
Notifications
You must be signed in to change notification settings - Fork 296
Description
Summary:
It would be helpful to introduce a --print-sql flag to django-rq, similar to the --print-sql functionality in django-extensions’s runserver_plus. This would print all executed SQL queries during job processing, making it much easier to identify performance bottlenecks during development.
Motivation:
When debugging performance issues in queued jobs, it’s currently tedious to trace which SQL queries are being executed unless we wrap things manually. Adding native support for query logging would significantly improve development and debugging workflows.
Implementation idea:
• The flag could be added to rqworker or rqscheduler, optionally enabling Django’s database query logging.
• This would be a development-only feature and should default to off.
• The implementation could reuse logic from django-extensions, or require it explicitly as a development dependency.
Question:
Would maintainers be open to a PR for this? If yes, should it rely on django-extensions or implement lightweight custom logging? considering the licensing and all.
Thanks