moqui-framework icon indicating copy to clipboard operation
moqui-framework copied to clipboard

will moqui support batch update, insert, delete?

Open li469791221 opened this issue 4 years ago • 3 comments

When I want to update multi columns using non pk conditions, I found the framework just find whole matched columns and then update them one by one. this will cause many db executions, so will moqui entity support batch update, insert and delete?

li469791221 avatar Jul 12 '21 03:07 li469791221

There hasn't been much need for this, at least not in most applications built to date using Moqui. From my experience when large bulk update queries are needed it is usually ad-hoc and might as well be done by hand (using pre- and post-queries for validation of results, etc).

This could be done, but not for all entities. There are a few optional features for entities and entity fields like maintaining the lastUpdatedStamp, audit log, cache clearing on updates (which requires all fields in case there are list caches that after the update should or should not contain the record), and I think there are more but those are off the top of my head.

For entities with cache=false (don't allow caching) and no audit logged fields we could allow this, perhaps automatically adding the new value for lastUpdatedStamp in the bulk update (update with non-PK where clause). Deletes are a bit easier, no lastUpdatedStamp to worry about, but would still have constraints on not allowing it unless the entity has cache=false.

jonesde avatar Jul 12 '21 03:07 jonesde

image

@jonesde Thanks for replying. I notice that you have mentioned this before, so do you still have a plan to support this.

li469791221 avatar Jul 12 '21 06:07 li469791221

About your question about a plan... it depends on what you mean by a plan. It's not something I or anyone I'm aware of has on a to do list with a commitment to get it done, if that's what you mean. While there is a set of base functionality in the framework to support various things, most framework functionality added over time is implemented for a specific need (when the solution to that need is likely to be useful for other Moqui users), and if funded (in time and/or money) by whoever has a sufficient need to justify the resources they dedicate to it.

Moqui is not owned by a company and is built (or marketed and sold) by a central group. Because of that there is no single roadmap or set of planned features. What there is instead: a number of different people and groups doing different things with Moqui, and each of those parties has their own objectives and requirements and roadmaps. Where those roadmaps include contributions to Moqui projects they are all together the roadmap for the core Moqui open source repositories. These roadmaps are only public in advance when contributors make them public in advance (via discussion, announcement, etc).

jonesde avatar Jul 20 '21 20:07 jonesde