-
Notifications
You must be signed in to change notification settings - Fork 32
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
upsert multi #110
Comments
Postgresql solution looks best, but it makes it fail if other dbms is used. Honestly I would opt for focusing on postgresql as the most popular dbms and making it as efficient as possible (I don't quite like the get and create approach as it costs additional call). That way we could efficiently cover bulk operations of all crud types. Igor mentioned that we might redesign some parts of the library and relase a breaking 1.x.x version, so that might be a good moment to get that transition. For now I think we should stick to the get and create/update approach for consistency. If you need that done soon, feel more than welcome to open a PR. Otherwise I might cover that but I'm having a few other issues to be finished first. @igorbenav your thoughts? |
I think what we should aim for eventually is a db "engine" approach, falling back to this get and create when engine is not specified, identified or covered, I think that would justify a breaking version. Until we do something like this, I believe creating the fallback would be the way to go |
Cool, will give it a try. |
Is your feature request related to a problem? Please describe.
If I currently want to upsert multiple records I would have to call
upsert
for each model which means a lot of overhead and unnecessary db calls. A Multi-upsert can also be done in just one query.Describe the solution you'd like
I would like to have an
upsert
function that allows inserting or updating multiple models. It doesn't have to be in one query necessarily. We can also continue with the current strategy using get and create or update.Describe alternatives you've considered
The current alternative (postgres specific) I am using is:
The text was updated successfully, but these errors were encountered: