Skip to content
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

Documention about raw connections with multiples databases #768

Closed
rafaelreuber opened this issue Jul 30, 2019 · 2 comments
Closed

Documention about raw connections with multiples databases #768

rafaelreuber opened this issue Jul 30, 2019 · 2 comments
Labels

Comments

@rafaelreuber
Copy link

flask-sqlalchemy support multiple connections through binds, but the documentation how to use raw connections is missing.

The issue #107 shows you could get the bind connection engine just using db.get_engine(app, 'oh_my_bind').execute(...).

The is missing the documentation about this nice feature.

@davidism davidism added the docs label May 26, 2020
@kennysong
Copy link

Apparently engine.execute() is deprecated in SQLAlchemy 2.0.

I think the future-proof way to do this will be something like db.create_scoped_session(...).execute(...).

@davidism
Copy link
Member

Yes, engine.execute is deprecated in SQLAlchemy itself. You don't need to create a session (and can't after #1087 makes those setup methods private), you should just do db.session.execute. #1087 makes the engines available in the db.engines dict mapping bind keys to engines.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants