-
-
Notifications
You must be signed in to change notification settings - Fork 899
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
Add use_batch_mode parameter to sqlalchemy create_engine #594
Comments
Hi, by accessing the engine's dialect you can manually set the member responsible for using the match_mode after the engine and dialect have been created. Assuming
|
Thank you, @nirizr ! I'll try that. |
Thanks @nirizr ! However, Flask-SQLAlchemy should really allow passing keyword parameters to create_engine. The simplest solution would be a configuration key, right? |
Yes. Probably. This is a workaround, not a fix :)
…On Wed, Aug 1, 2018, 01:15 moi90 ***@***.***> wrote:
Thanks @nirizr <https://github.com/nirizr> !
However, Flask-SQLAlchemy should really allow passing keyword parameters
to create_engine. The simplest solution would be a configuration key, right?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#594 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADdqV3J5fnNQwmyJaq111UY-JGWfq4GFks5uMWOkgaJpZM4SJkfk>
.
|
Hi, I also had the need to specify extra kwargs to the underlying call to To do so, I used the method
What you need to do is to define your own class that overload this method: class SQLAlchemyCustomized(flask_sqlalchemy.SQLAlchemy):
def apply_driver_hacks(self, app, info, options):
options['use_batch_mode'] = True
super().apply_driver_hacks(app, info, options) And then use your class instead of the default one: # Replace "db = SQLAlchemy(app)" by
db = SQLAlchemyCustomized(app) Hope that helps :) |
This will be resolved by: #166 |
I would like to add use_batch_mode parameter or sqlalchemy create_engine. Is there something that allows this or can I work on a pull request? What would be the best approach in the case of pull request?
Source on use_batch_mode:
The text was updated successfully, but these errors were encountered: