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 a skip_update field attribute for #[derive(AsChangeset)] (#860) #4364

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jaltaire
Copy link

Implement skip_update attribute for #[derive(AsChangeset)] as described here: #860 (comment).

@Jaltaire
Copy link
Author

@weiznich, I'm wondering if skip_update should be a separate attribute, or if it should be rolled into skip_insertion and renamed?

If the purpose of both attributes is to skip the corresponding operation on a generated column, is there ever a case where we would want to skip_insertion but not skip_update, or vice versa? Perhaps there is a scenario in which this is valid of which I am not considering, but if not, I do think this makes for a more error-prone implementation, by requiring these annotations be needlessly duplicated for what should be consistent behavior between inserts and updates. On the other hand, should someone require differing behavior for their particular use case, then we already get that functionality here.

@weiznich weiznich requested a review from a team November 26, 2024 09:52
@Ten0 Ten0 changed the title ignore skip_update fields on #[derive(AsChangeset)] (#860) Add a skip_update field attribute for #[derive(AsChangeset)] (#860) Nov 26, 2024
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

Successfully merging this pull request may close these issues.

1 participant