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

Set command supports NX and GET options used together #1925

Closed
1 of 2 tasks
siwee opened this issue Dec 7, 2023 · 4 comments · Fixed by #1935
Closed
1 of 2 tasks

Set command supports NX and GET options used together #1925

siwee opened this issue Dec 7, 2023 · 4 comments · Fixed by #1935
Labels
enhancement type enhancement

Comments

@siwee
Copy link

siwee commented Dec 7, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

Motivation

New features in Redis 7.0.0.

History

  • Starting with Redis version 2.6.12: Added the EX, PX, NX and XX options.
  • Starting with Redis version 6.0.0: Added the KEEPTTL option.
  • Starting with Redis version 6.2.0: Added the GET, EXAT and PXAT option.
  • Starting with Redis version 7.0.0: Allowed the NX and GET options to be used together.

redis docs: https://redis.io/commands/set/

Solution

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@siwee siwee added the enhancement type enhancement label Dec 7, 2023
@git-hulk
Copy link
Member

git-hulk commented Dec 8, 2023

Hi @tarvfx, thanks for your proposal.

From the Kvrocks side, what we need to be supported in the SET command are:

  • KEEPTTL option(EX, PX, NX and XX options are supported now)
  • Allowed to use the GET option together with EXAT/PXAT/NX

Did I miss anything?

@siwee
Copy link
Author

siwee commented Dec 11, 2023

Hi, @git-hulk

Thanks, you filled in what I missed.

@jihuayu
Copy link
Member

jihuayu commented Dec 12, 2023

Adding the KEEPTTL and GET option to the set command is difficulty in the current implementation.
I will change the types/redis_string#Set function impl, Make it compatible with the new format of the Set command. And make SetEX, SetNX, SetXX call the new Set function

@git-hulk
Copy link
Member

@jihuayu Thank you!

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

Successfully merging a pull request may close this issue.

3 participants