-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add an api for toggle KV for all merchants #4600
Conversation
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>( | ||
conn, | ||
dsl::merchant_id.ne_all(vec![""]), | ||
merchant_account, | ||
) | ||
.await |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this specific API, you could have used generic_update()
which returns the number of rows updated. But I understand this function is meant to be generic enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used update_with_results
to have a check if all the MerchantAccount returned from the list have desired value or not. But left it because seemed redundant
d5b7857
to
72b559f
Compare
Type of Change
Description
Add an API to toggle KV for all merchants
Additional Changes
Motivation and Context
Add an API to toggle KV for all merchants
How did you test it?
Check if any merchant_account has
postgres_only
.It should return 0 rows
-Disable KV for all merchants
Check if any merchant_account has
redis_kv
It should return 0 rows
Checklist
cargo +nightly fmt --all
cargo clippy