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

Bulk insert support #142

Merged
merged 7 commits into from
Jun 15, 2019
Merged

Bulk insert support #142

merged 7 commits into from
Jun 15, 2019

Conversation

grigi
Copy link
Member

@grigi grigi commented Jun 14, 2019

Add support for Bulk Insert support.
Fixes #93

  • Bulk insert interface
  • execute_many for SQLite
  • execute_many for PostgreSQL
  • execute_many for MySQL
  • Profiled and resolved a many small bottlenecks re insertion, standard insertion is faster now as well. (Updated https://github.com/tortoise/orm-benchmarks with results)
  • Tests
  • Documentation
  • Changed SQLite transaction to default to WAL (requires SQLite ≥ 3.7, which is 8 years old), as without it bulk inserts performed no better than single inserts.

@grigi
Copy link
Member Author

grigi commented Jun 14, 2019

@abondar Can you please review?

Copy link
Member

@abondar abondar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems great to me 👍

]
for instance in instances
]
await self.db.execute_many(self.query, valueses)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really think valueses is actual word 😄
Ma be values_lists would be better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked my wife, and she said a correct usage would be values's but valueses is just irritatingly wrong. Another option could be values_of_values, or shortened: vovs 🤣
I'll change it to values_lists 😄

@grigi grigi merged commit c984426 into master Jun 15, 2019
@grigi grigi deleted the executemany branch August 24, 2019 05:15
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

Successfully merging this pull request may close these issues.

Any plans to add a executemany methods?
2 participants