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

aiopg.sa bulk inserts / executemany #112

Closed
bcmyers opened this issue Apr 5, 2016 · 5 comments
Closed

aiopg.sa bulk inserts / executemany #112

bcmyers opened this issue Apr 5, 2016 · 5 comments

Comments

@bcmyers
Copy link

bcmyers commented Apr 5, 2016

Apologies in advance if this is the wrong forum for a question like this, but I was wondering if you have any plans to add bulk insert / executemany functionality for the SQLAlchemy wrapper in the future. My understanding (which may be wrong) is that this functionality is not in the current version. Just curious if it's something that will eventually be added? Thanks!

@andreipruteanu
Copy link

Same question from my side as well. Any plans to add bulk insert functionality?

@asvetlov
Copy link
Member

AFAIK psycopg2 doesn't support executemany in asynchronous mode.
So no way to implement it in aiopg, sorry.

@andreipruteanu
Copy link

It's a pity. It would of been nice to have this functionality supported due to the considerable speed improvements it brings. Thank you for the answer !

@bcmyers
Copy link
Author

bcmyers commented Apr 22, 2016

Thanks for the response! I figured there was some sort of technical reason why this functionality couldn't be made asynchronous. Totally get it. That being said, perhaps you could add a light wrapper around sqlalchemy's bulk insert functionality and note heavily in documentation that it's a synchronous operation. It's so much faster for large data inserts that I have code that uses aiopg throughout but then switches for this one case back to sqlalchemy. Not too terrible, but just feels weird. I don't know. Just a thought. Keep up the awesome work! Wish I knew enough programming to contribute more!

@asvetlov
Copy link
Member

If you need a synchronous DB call like bulk insert please use sync driver.
The request is out of scope of aiopg library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants