-
-
Notifications
You must be signed in to change notification settings - Fork 149
Support raw SQL Alchemy #75
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
Conversation
DebugToolbar can receive an sql alchemy engine explicitly, in which case it will install engine events that record queries. Otherwise, it falls back to old Flask-SQLAlchemy behavior.
|
What about this request? Does actually this extension is maintained by someone? |
|
Sorry, yes I've been rather behind on the maintenance of this project. I'll follow up on the original issue #71 with some thoughts on this. |
|
Would be great to support raw SQLAlchemy. I have a app built on Flask for web and Tornado for IM and push service, and I reused the model layer on raw SQLAlchemy. |
|
any news of this front ? |
|
There's a conflict now. |
|
I would like to add support for raw SQLAlchemy here. It's been a while since this was looked at though, so I'm not sure what changes are needed... @dtheodor do you mind rebasing to fix merge conflicts so we get a clean slate for testing/discussing the actual implementation? |
|
For anyone that wants this sort of functionality, a separate python module exists called fdt-sqlalchemy. It has a bug where there is an errant print, which I've removed and documented a workaround for here. |
|
I know it's been a long time, but do you still have any interest in this? |
This is an attempt to fix #71.
It adds a new argument
sqlalchemy_enginetoDebugToolbarExtension(app, sqlalchemy_engine=None). If no engine is passed, the old behavior is maintained. If an engine is passed, then the query recording events are installed on that engine and noflask-sqlalchemydbis touched. The event registration still uses flask-sqlalchemy code.This still requires
flask-sqlalchemyto be installed in order to record queries, but it does not require the user to use it to declare models and query for data; raw sqlalchemy engines and tables can be used instead. I added a basic app example that uses plain sql alchemy underbasic_app_raw_sqlalchemy.py