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: GETEX and GETDEL Added #582
Conversation
Hi @djc ! Can you please approve this? |
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.
I think this should come with some tests.
src/commands.rs
Outdated
@@ -397,6 +397,16 @@ implement_commands! { | |||
cmd("PTTL").arg(key) | |||
} | |||
|
|||
/// Get the value of a key and set expiration | |||
fn get_ex<K: ToRedisArgs>(key: K, seconds: usize) { |
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 get_ex
, I think it would be good to support EX
/PX
/EXAT
/PXAT
and PERSIST
options as well. For the former, it probably makes sense to define an enum, or maybe a custom Duration
type with some simple constructors?
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.
I have now added support for those options and also created tests for get_ex
and get_del
. CI shows that build failed on 1.51.0 but I think that is due to unrelated issue. Can you please review the changes?
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.
Yeah, the MSRV issue is #624.
I have made the requested changes. |
Thanks! |
This PR adds the following commands:
Closes #485