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

Add support for Create, Update and Delete multiple entries with hooks #61

Open
dwill20 opened this issue Jan 29, 2022 · 0 comments
Open
Assignees

Comments

@dwill20
Copy link

dwill20 commented Jan 29, 2022

Is your feature request related to a problem? Please describe.

  • Problem
    • Currently, hook is supported only for the following methods.
      • Create & CreateWithCtx
      • Update & UpdateWithCtx
      • Delete & DeleteWithCtx
    • This is inconvenient to create/update/delete multiple entries as the hook support does not exist. One must loop over the above methods to operate over multiple entries.
    • It's difficult to perform atomic operations and rollback (when dealing with multiple entries), if using just the above mentioned function, as one must define transaction and so on, creating verbose code.

Describe the solution you'd like

  • Add support for methods that allows creating/updating/deleting multiple entries, with support for hooks.

Describe alternatives you've considered

  • Currently the solution with the above mentioned methods include,
    • Looping over the methods to perform batch operations
    • Wrapping batch operation in transaction, so that rollback can be performed in case of failure
    • Using native methods (e.g. InsertMany, UpdateMany, DeleteMany). But, hook support does not exist.

Additional context

  • N/A
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

2 participants