8000 Related models are updated on Update() even if no related columns are specified · Issue #233 · src-d/go-kallax · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Related models are updated on Update() even if no related columns are specified #233

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

Open
nadiamoe opened this issue Aug 24, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@nadiamoe
Copy link
Contributor

If a model has relations, they will be saved after calling parentStore.Update(parent, Schema.Parent.PlainString), even if their FKs are not included in the cols... list.

This behaviour is not breaking, but kind of suboptimal. Most of the time you specify which columns must be updated it's because you don't want to touch any other thing.

It can be considered problematic if the user assumes that only the specified fields will be updated.

@niondir
Copy link
Contributor
niondir commented Aug 29, 2017

This is similar to the issues discussed in: #232 #211 #214 #219

@nadiamoe
Copy link
Contributor Author

I'm inclined towards changing kallax behaviour to this, but the change might be seen as breaking. The documentation does not state this behaviour clearly, but some users might be relying on this "feature".

Depending on how #219 is addressed, this may or may not be required. If this were to happen, it should be on version 2.0 to avoid breaking existing user code.

@nadiamoe nadiamoe self-assigned this Nov 23, 2017
@nadiamoe nadiamoe added the v2 label Nov 23, 2017
@nadiamoe nadiamoe added this to the v2.0.0 milestone Nov 23, 2017
@Azuka
Copy link
Azuka commented May 15, 2018

Hi. I just wanted to check on this as I'm seeing strange side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
0