feat: add SET IFEQ/IFNE/IFDEQ/IFDNE condition options plus DIGEST and DELEX commands - #52
feat: add SET IFEQ/IFNE/IFDEQ/IFDNE condition options plus DIGEST and DELEX commands#52lkwr wants to merge 2 commits into
Conversation
DELEX commands Support the conditional SET subcommands introduced in Redis 8.4, along with the supporting DIGEST (XXH3 hash digest) and DELEX (conditional delete) commands. - CommandSetOptions: add setIfValueEquals/setIfValueNotEquals and setIfDigestEquals/setIfDigestNotEquals, mapped to the IFEQ/IFNE/IFDEQ/IFDNE tokens in buildSetCommand. - Add digest(key) returning the XXH3 hex digest of a string value. - Add delex(key, options?) returning 0/1 with the same four condition options via the new buildDelexCommand and CommandDelexOptions type. - Wire both commands into the command index and SolidisFeaturedClient. - Add builder unit tests and capability-probed integration tests in the strings suite; gating probes each option rather than relying on version detection, since distributions differ (Valkey 9.1 supports IFEQ only).
|
@lkwr is attempting to deploy a commit to the vcms-io Team on Vercel. A member of the Team first needs to authorize it. |
d37c28d to
dc41d63
Compare
Drop the duplicate probeOptionSupported helper in the strings suite and probe the Redis 8.4 SET/DELEX condition options through the shared isCommandSupported utility, renaming the capability flags to the *Available style used elsewhere. isCommandSupported now treats "syntax error" replies as unsupported alongside "unknown command", letting it gate subcommand options whose coverage differs between Redis and Valkey (e.g. Valkey 9.1 supports IFEQ only).
dc41d63 to
c5f6664
Compare
|
@lkwr I apologize for the delay in checking this as I missed the notification. Thank you for your contribution! Went through this against the Redis 8.4 and Valkey docs. The problem is that almost none of this is actually being tested. Nothing in the CI matrix is Redis 8.4. I checked all ten images. Valkey diverged and the PR doesn't know about it. The We already have the right tool for this.
The two condition blocks are the same code twice: The new tests are commented and the suite isn't. There are zero // IFEQ mismatch is a no-op.
assert.strictEqual(await client.set(key, 'b', { setIfValueEquals: 'x' }), null);
assert.strictEqual(await client.get(key), 'a');The Same lens on the Smaller stuff:
Unrelated, but now that Thank you! |
Support the conditional SET subcommands introduced in Redis 8.4, along with
the supporting DIGEST (XXH3 hash digest) and DELEX (conditional delete) commands.
I've migrated a project from
@redis/clientto@vcms-io/solidisand noticed that theSET ... IFEQoption wasn't available, so I decided to add support for it, along with other related options and commands.I know I could send the command manually, but having native support is much more convenient.