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

upsertMany should split to batch #4421

Closed
wenerme opened this issue Jun 5, 2023 · 3 comments
Closed

upsertMany should split to batch #4421

wenerme opened this issue Jun 5, 2023 · 3 comments

Comments

@wenerme
Copy link

wenerme commented Jun 5, 2023

Describe the bug

image

Stack trace

To Reproduce

upsertMany with a lot rows.

Expected behavior

Additional context

Versions

Dependency Version
node ?
typescript ?
mikro-orm ?
your-driver better-sqlite
@B4nan
Copy link
Member

B4nan commented Jun 5, 2023

What does "a lot" mean, how complex your entity is? Note that I can see from your screenshot that you don't await the upsert call.

@rubiin
Copy link
Contributor

rubiin commented Jul 13, 2023

Describe the bug

image **Stack trace**

To Reproduce

upsertMany with a lot rows.

Expected behavior

Additional context

Versions

Dependency Version
node ?
typescript ?
mikro-orm ?
your-driver better-sqlite

https://antfu.me/posts/why-reproductions-are-required

@wenerme
Copy link
Author

wenerme commented Jul 13, 2023

for SQLIite SQLITE_MAX_COMPOUND_SELECT=500 (https://www.sqlite.org/limits.html), it's easy to rich the limit when using batch, maybe related to how sqlite is generated, I think mikro orm should support the automatic batch split or allowed pass a batch size options.

I think this error is common enough, it's easy to get the point.

@B4nan B4nan closed this as completed in 4a21c33 Aug 27, 2023
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