-
Notifications
You must be signed in to change notification settings - Fork 259
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
Use executemany
from backends
#371
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected a change in
https://github.com/encode/databases/blob/master/databases/core.py#L281-L286
instead of creating multiple queries to take again the first one afterwards
Do I miss something? 🤔
Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
@PrettyWood Yeah I actually thought that would be more efficient too. If I understand your comment correctly, you want to avoid building all the queries in I tried that before and there's a limitation. If we build only the first query in Even if we could make this work with SQLAlchemy orm I think it won't work well with raw queries. For building raw queries we're using tldr; I think if we want to avoid building all queries and compiling queries and params, we would have to build query params ourself and not use I'm really interested to improve this and get it through. So feel free to dig deeper and let me know if we can improve it. |
Closing it as stale. |
Closes #284
Some of the backends support
executemany
and instead of running multiple single queries we can useexecutemany
.asyncpg, aiosqlite and aiomysql support
executemany
butaiopg
doesn't support it.