-
Notifications
You must be signed in to change notification settings - Fork 2k
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
adapter.createEach not called #5501
Comments
Yes, it should be called when calling |
I haven't tested, but I'm afraid See On the other hand, the adapter It appears If this is indeed a bug, we'll have to do some work to hook the lifecycle into |
Back in balderdashy/waterline#980 (comment) I did notice sails-postgresql and sails-mysql were using waterline's
I think it is.
Agreed. |
Same here. It is causing really slow write performance as batch writes are not using adapter's createEach() method, rather sending individual create queries and thus insert performance is drastically degraded. As a clue, the findOrCreateEach() method is properly calling adapter's method if adapter implemented one. |
Sending createEach values to adapter's optimized .createEach() method Will fallback to normal create if adapter doesn't implement .createEach()
Hi @masumsoft, I've left some comments (balderdashy/waterline#1018 (comment)) on PR #1018. Please take a look. |
Hi @dmarcelino, Thanks for the nice feedback. I was a bit busy this week, didn't have much time to look at it, will try to resolve the issues mentioned by you asap. |
Updated the PR #1018 with new commits, details available there. |
Thanks for posting, @atiertant. I'm a repo bot-- nice to meet you! It has been 60 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:
Thanks so much for your help! |
This has a PR in the works. |
The main issue with this is handling nested creates. That's why it currently loops through and runs • Set model default values If we were to pass that whole array to the adapter's Now we could simplify this and say you can't do nested creates in a |
@particlebanana an other way would be to group flat insert by model so an array of two level nested create could be insert in two createEach like deepPopulate but with nested create logic. |
Thanks for posting, @atiertant. I'm a repo bot-- nice to meet you! It has been 30 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:
Thanks so much for your help! |
This is on the roadmap file. Closing it now. To clarify there needs to be a proposal as to how this change effects all the various nested updates operations. |
adapter.createEach is only called in alter mode to reinsert data.
shouldn't it optimize insertion of multiple data ?
The text was updated successfully, but these errors were encountered: