Flask SQLAlchemy display queries for debug
I haven't used it myself, but it seems that Flask Debug-toolbar may help with this.
https://github.com/mgood/flask-debugtoolbar
It's a port of the django-debug-toolbar, which can be used for profiling queries.
The documentation of Flask Debug-toolbar doesn't mention it, but there is code for a SQLAlchemyDebugPanel.
So I think it may be well worth to take a look at the project, and see if it does what you need.
app.config['SQLALCHEMY_ECHO'] = True
If you're using the Flask-SQLAlchemy extension and don't want to bother with create_engine
, you can set the configuration key SQLALCHEMY_ECHO=True
.
http://flask-sqlalchemy.pocoo.org/2.1/config/