Skip to content

Enabling support for missing sorted set commands#5379

Open
pratheep-kumar wants to merge 4 commits intovalkey-io:mainfrom
pratheep-kumar:enable-sorted-set-commands
Open

Enabling support for missing sorted set commands#5379
pratheep-kumar wants to merge 4 commits intovalkey-io:mainfrom
pratheep-kumar:enable-sorted-set-commands

Conversation

@pratheep-kumar
Copy link
Contributor

@pratheep-kumar pratheep-kumar commented Feb 17, 2026

Summary

Added support for 5 sorted set range commands in glide-core request_type: ZRANGEBYLEX, ZRANGEBYSCORE, ZREVRANGE, ZREVRANGEBYLEX, and ZREVRANGEBYSCORE.

Issue link

This Pull Request is linked to issue (URL): #5380

Features / Behaviour Changes

This PR adds Rust-level support for the following sorted set commands:

  • ZRANGEBYLEX - Returns members in a sorted set within a lexicographical range
  • ZRANGEBYSCORE - Returns members in a sorted set within a score range
  • ZREVRANGE - Returns members in a sorted set by index (in reverse order)
  • ZREVRANGEBYLEX - Returns members in a sorted set within a lexicographical range (in reverse order)
  • ZREVRANGEBYSCORE - Returns members in a sorted set within a score range (in reverse order)

These commands were already defined as enum variants but were missing their implementations in the command mapping layer.

Implementation

Key changes in glide-core/src/request_type.rs:

  1. Added command implementations in get_command() method (lines 986-990):

    RequestType::ZRangeByLex => Some(cmd("ZRANGEBYLEX")),
    RequestType::ZRangeByScore => Some(cmd("ZRANGEBYSCORE")),
    RequestType::ZRevRange => Some(cmd("ZREVRANGE")),
    RequestType::ZRevRangeByLex => Some(cmd("ZREVRANGEBYLEX")),
    RequestType::ZRevRangeByScore => Some(cmd("ZREVRANGEBYSCORE")),
  2. Added protobuf mappings in From<ProtobufRequestType> implementation (lines 590-594):

    ProtobufRequestType::ZRangeByLex => RequestType::ZRangeByLex,
    ProtobufRequestType::ZRangeByScore => RequestType::ZRangeByScore,
    ProtobufRequestType::ZRevRange => RequestType::ZRevRange,
    ProtobufRequestType::ZRevRangeByLex => RequestType::ZRevRangeByLex,
    ProtobufRequestType::ZRevRangeByScore => RequestType::ZRevRangeByScore,

Both mappings were strategically placed after ZRangeStore to maintain logical grouping with other sorted set range commands.

Limitations

  • This PR only adds support at the glide-core (Rust) layer
  • Language-specific bindings (Java, Python, Node.js, Go) will need separate PRs to expose these commands
  • No new integration tests added in this PR (existing tests verify compilation)

Testing

  • ✅ Rust compilation passes: cargo build completed successfully
  • ✅ No linting errors: Code passes Rust linter checks
  • ⚠️ Integration tests for these specific commands not yet added (existing test suite still passes)

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Linters have been run (make *-lint targets) and Prettier has been run (make prettier-fix).
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

Signed-off-by: Pratheep Kumar <pratheepkumar0403@gmail.com>
@pratheep-kumar pratheep-kumar requested a review from a team as a code owner February 17, 2026 09:58
Signed-off-by: Pratheep Kumar <pratheepkumar0403@gmail.com>
Signed-off-by: Pratheep Kumar <pratheepkumar0403@gmail.com>
@pratheep-kumar pratheep-kumar force-pushed the enable-sorted-set-commands branch from 911c61f to 53946c7 Compare February 17, 2026 10:44
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.

1 participant