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

Implement if_not_exists for update #230

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

KentaKudo
Copy link
Contributor

@KentaKudo KentaKudo commented Oct 9, 2023

What does this change?

Utilised DynamoDB's if_not_exists function when updating an attribute.

References

Screenshots

If applicable, add screenshots to help explain your changes.

What can I check for bug fixes?

Please briefly describe how you can confirm the resolution of the bug.

let expression = if self.if_not_exists {
format!(
"{} = if_not_exists({}, {})",
attr_name, attr_name, set_attr_name
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now it assumes the attribute to check presence is the same one as the attribute that's being set i.e. it only allows SET price = if_not_exists(price, 1000) and can't do something like SET price = if_not_exists(unit_price, 1000)

Copy link
Member

@bokuweb bokuweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bokuweb bokuweb merged commit 8fd1362 into raiden-rs:master Oct 10, 2023
1 check passed
@KentaKudo KentaKudo deleted the feat/if-not-exists branch October 10, 2023 07:20
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.

2 participants