Skip to content

[FEATURE] Supporting GET in SET #658

@Ender-events

Description

@Ender-events

Is your feature request related to a problem? Please describe.
As of Redis version 6.2.0, the command GETSET is regarded as deprecated.
It can be replaced by SET with the GET argument when migrating or writing new code.

Describe the solution you'd like
maybe this interface to avoid breaking change

 OptionalString setget(const StringView &key,
                       const StringView &val,
                       const std::chrono::milliseconds &ttl = std::chrono::milliseconds(0),
                       UpdateType type = UpdateType::ALWAYS);

 OptionalString setget(const StringView &key,
                       const StringView &val,
                       bool keepttl,
                       UpdateType type = UpdateType::ALWAYS);

Describe alternatives you've considered
Keep using getset or use transaction with get then set

Additional context
If you know what interface you want, I can do a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions