Skip to content

Conversation

@samuelhwilliams
Copy link

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.

@samuelhwilliams
Copy link
Author

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.

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.
@samuelhwilliams samuelhwilliams marked this pull request as ready for review June 29, 2025 20:56
@samuelhwilliams
Copy link
Author

@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?

@davidism
Copy link
Member

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.

@davidism
Copy link
Member

davidism commented Nov 6, 2025

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

@davidism davidism closed this Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants