feat(client): add Redis 8.8 array commands#3285
Merged
Merged
Conversation
Adds support for the 19-command AR* family introduced in Redis 8.8:
ARSET, ARGET, ARGETRANGE, ARMSET, ARMGET, ARLEN, ARCOUNT, ARNEXT,
ARINFO, ARDEL, ARDELRANGE, ARSCAN, ARGREP (+WITHVALUES), ARINSERT,
ARRING, ARSEEK, ARLASTITEMS, AROP.
Notable design choices:
- All index inputs accept `number | string` so callers can pass decimal
strings for indices above `Number.MAX_SAFE_INTEGER` (the server's
index space is uint64). Output-side precision is delegated to the
existing codebase-wide escape hatch:
`client.withTypeMapping({ [RESP_TYPES.NUMBER]: String })`, with
@remarks pointing at it on every AR* command that may return a large
index.
- ARGREP accepts the open-ended bounds `'-'` and `'+'` in addition to
numeric indices, in any combination.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Reviewed by Cursor Bugbot for commit e3450bc. Configure here.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds support for the 19-command AR* family introduced in Redis 8.8: ARSET, ARGET, ARGETRANGE, ARMSET, ARMGET, ARLEN, ARCOUNT, ARNEXT, ARINFO, ARDEL, ARDELRANGE, ARSCAN, ARGREP (+WITHVALUES), ARINSERT, ARRING, ARSEEK, ARLASTITEMS, AROP.
Notable design choices:
number | stringso callers can pass decimal strings for indices aboveNumber.MAX_SAFE_INTEGER(the server's index space is uint64). Output-side precision is delegated to the existing codebase-wide escape hatch:client.withTypeMapping({ [RESP_TYPES.NUMBER]: String }), with @remarks pointing at it on every AR* command that may return a large index.'-'and'+'in addition to numeric indices, in any combination.Description
Checklist
npm testpass with this change (including linting)?Note
Medium Risk
Adds a large new surface area of Redis commands and associated typings/transformers, which could introduce API/typing mismatches or reply-shape bugs despite being largely additive and version-gated.
Overview
Adds client support for the Redis 8.8
AR*“array” command family, wiring new command builders intopackages/client/lib/commands/index.tsand exposing them via the public client API (e.g.client.arSet,client.arGrep,client.arOp).Introduces argument/option typing for array indices (supporting
number | string, plus'-'/'+'bounds forARGREP) and exports new constants (AR_PREDICATE_TYPES,AR_PREDICATE_COMBINATORS,AR_OPERATIONS) from bothlib/commandsand the package entrypoint.Adds extensive unit/integration tests for the new commands (including edge cases like sparse arrays, cursor behavior, modifier ordering, and server-side error validation), gated to Redis versions
>= 8.8.Reviewed by Cursor Bugbot for commit a2166df. Bugbot is set up for automated code reviews on this repo. Configure here.