-
Notifications
You must be signed in to change notification settings - Fork 58
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. |
Belatedly, one thing I want to note about this, because it bit me as I was trying to get an unrelated PR together, is that there is now an unspoken development dependency on Docker by way of the tests bringing in If you're okay with that, then fine, but it should at least be documented. (My preference, however, would be to somehow remove the dependency, or at least make it so it's only needed if you want to specifically run the tests that require it, separate from the main body of tests.) |
I didn't know we document our dev deps anywhere. We can Imho Btw you can also exclude those tests by adding sth. like |
Well, we kind of do, by way of Anyway, I don't necessarily disagree about |
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: