Implement SQLALCHEMY_RECORD_QUERIES#21
Implement SQLALCHEMY_RECORD_QUERIES#21samuelhwilliams wants to merge 1 commit intopallets-eco:mainfrom
Conversation
|
Closing off; this was copied over to support flask-debugtoolbar which relies on this functionality in full-fledge flask-sqlalchemy. I'll look at baking this all directly into flask-debugtoolbar. |
bf87de8 to
5f791cd
Compare
Lifted verbatim from [Flask-SQLAlchemy](https://github.com/pallets-eco/flask-sqlalchemy/blob/3e3e92ba557649ab5251eda860a67656cc8c10af/src/flask_sqlalchemy/record_queries.py). Adding support for this will enable integration with Flask-DebugToolbar.
5f791cd to
1751552
Compare
|
@davidism thanks for opening this again - I've added tests to the PR now, broadly in line with the test that Flask-SQLAlchemy has: https://github.com/pallets-eco/flask-sqlalchemy/blob/main/tests/test_record_queries.py. Is this still something you're willing to help get in? |
|
I will get to this eventually. I'm still not 100% sure on if or how I want to add it, so I'll need to find some time to review and play around with this. |
|
I've thought about this on and off over the past months. I'm concluding that it makes more sense to add this to Flask-DebugToolbar rather than here. There's nothing truly Flask-specific about this code, except for where it chooses to store the queries. It only seems to have a use case with Flask-DebugToolbar, other dashboards such as Sentry, OpenTelemetry, etc have their own monitoring integrations. Moving it to Flask-DebugToolbar would also allow you to support plain SQLAlchemy pallets-eco/flask-debugtoolbar#110 |
Provisionally opened to gauge whether this is something we'd be willing to bring in. If so I'll lift and apply tests as needed 👀 I would find this v useful though (will need an update to flask-debugtoolbar as well, which I'm happy to work on if this goes in).
Lifted verbatim from
Flask-SQLAlchemy. Adding support for this will enable integration with Flask-DebugToolbar.