Description
Hi @NickCraver @mgravell , as we discussed a few weeks ago (with @chayim and @gkorland) I went through the library and compiled a list of what I believe are the missing commands of StackExchange.Redis.
Methodology
I basically diffed RedisCommand.cs with the main Redis Project's commands.json, which resulted in ~180 commands, I went through and purged most of the commands that felt like they were admin/config (except ACL) to preserve the more interactive commands, this left ~70. Then I went through the library to see if the sub-commands that came up (a lot of stuff from XGROUP XINFO and a few others) were already covered by a combination of the command Enum + a literal to filter those out as they are already supported. After that, and collapsing the many sub-commands of FUNCTION
and ACL
, we're left with 47. I think what follows is mostly correct (in that the thing is ACTUALLY missing, and that it's something that you would probably want to add to the library if it were feasible). I marked the blocking commands, and then applied a bit of my own reason to determine if I thought the command would be addable without a major overhaul of the library. I also added the Redis Version the command was added in (about 40% of the missing commands are 7.0, I don't know what your policy is on adding Release candidate commands, I'm guessing you wouldn't want to :) )
As it stands, there are about 21 commands which are in stable versions of Redis, interactive, and shouldn't require any major architectural changes, call them low-hanging fruit. Seems like there are a few commands that were either just missed, or there's some story behind why they never made it in (BITFIELD
, some OBJECT
subcommand, SCRIPT KILL
, LOLWUT
(ok maybe a bit silly, but can always use a bit of levity)). And then I'm guessing there hasn't been a command refresh since 6.0
This is meant as a starting point, for my part, I'm happy to start opening PRs for any commands you'd approve of adding. I understand the reviews can be burdensome and do not want to overwhelm you, so just let me know what you want to be added and I'm happy to get started.
Full List
All the missing commands, including 7.0 commands and things that are going to be a bigger headache to add.
Command Name | PRs | Interface | Proposed names | Notes | |
---|---|---|---|---|---|
ACL (+sub-commands) | 6 | (TBD) | Skip: Broader discussion | ||
BITFIELD | #2107 | 3.2 | IDatabase | StringBitFieldSet/StringBitFieldGet/StringBitFieldIncrement/StringBitField | This API might be tricky, the command is variadic, so an array of sub-commands may make sense, or the three sub-commands split out, or both could work. Also, might want a clever return-type. |
BITFIELD_RO | #2107 | 6.2 | IDatabase | see notes | Consider intelligently interrogating the commands executed to see if they are RO. |
BLMOVE | 6.2 | IDatabase | Skip: Blocking | ||
BLMPOP | 7 | IDatabase | Skip: Blocking | ||
BZMPOP | 7 | IDatabase | Skip: Blocking | ||
BZPOPMAX | 5 | IDatabase | Skip: Blocking | ||
BZPOPMIN | 5 | IDatabase | Skip: Blocking | ||
#2064 | 6.2 | IDatabase | KeyCopy | ||
EVALSHA_RO | 7 | IDatabase | ScriptEvaluateReadOnly | ||
EVAL_RO | 7 | IDatabase | ScriptEvaluateReadOnly | ||
#2083 | 7 | IDatabase | KeyExpireTime | ||
FCALL | 7 | IDatabase | Skip: Pending functions design | ||
FCALL_RO | 7 | IDatabase | Skip: Pending functions design | ||
FUNCTION (+sub-commands) | 7 | IDatabase | Skip: Pending functions design | ||
#2089 | 6.2 | IDatabase | GeoSearch | ||
#2089 | 6.2 | IDatabase | GeoSearchAndStore | ||
#1743 | IDatabase | StringGetSetExpiry | |||
#2090 | 6.2 | IDatabase | HashRandomField | ||
#2104 | 7 | IDatabase | LongestCommonSubsequence | ||
#2065 | 6.2 | IDatabase | ListMove | ||
#2094 | 7 | IDatabase | Overload ListLeftPop and ListRightPop | ||
#2080 | 6 | IDatabase | ListPosition/ListPositions | ||
#2088 | 2.2 | IDatabase | KeyEncoding | ||
#2105 | 4 | IDatabase | KeyFrequency | This can only be used if maxmemory-policy is set to an LFU policy, might be worth some command-map manipulation to interrogate this policy. | |
#2087 | 2.2 | IDatabase | KeyRefCount | ||
#2083 | 7 | IDatabase | KeyExpireTime | Overload that specifies to get the expire-time in milliseconds | |
PUBSUB SHARDCHANNELS | 7 | IServer | SubscriptionShardChannels | ||
PUBSUB SHARDNUMSUB | 7 | IServer | SubscriptionShardSubscriberCount | ||
SCRIPT KILL | 2.6 | IServer | ScriptKill | ||
#2078 | 7 | IDatabase | SetIntersectionLength | This could also be SetCombineLength, I worry though because there's no corresponding union/diff commands yet that this can lead to some confusion. | |
#2077 | 6.2 | IDatabase | Overload SetContains | ||
#2111 | 7 | IDatabase | SortReadOnly | Another option is to just change the Sort method to use the SORT_RO, but I fear that's a break (and there would need to be some other logic to determine if SORT_RO is available on the Redis Server | |
SPUBLISH | 7 | (TBD) | Skip: Pending sharded pub-sub design | ||
SSUBSCRIBE | 7 | (TBD) | Skip: Pending sharded pub-sub design | ||
SUNSUBSCRIBE | 7 | (TBD) | Skip: Pending sharded pub-sub design | ||
WAIT | 3 | (TBD) | Skip: Blocking | ||
#2095 | 6.2 | IDatabase | StreamAutoClaim | ||
#2075 | 6.2 | IDatabase | SortedSetCombine | ||
#2075 | 6.2 | IDatabase | SortedSetCombine | ||
#2075 | 6.2 | IDatabase | SortedSetCombine | ||
#2075 | 7 | IDatabase | SortedSetIntersectionLength | Same comment as with SINTERLENGTH | |
#2094 | 7 | IDatabase | Overload SortedSetPop | ||
#2082 | 6.2 | IDatabase | Overload SortedSetScore | ||
#2076 | 6.2 | IDatabase | SortedSetRandomMember | ||
#2075 | 6.2 | IDatabase | SortedSetCombine |