dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.52k stars 933 forks source link

SRANDMEMBER Support #2137

Closed admtech closed 11 months ago

admtech commented 11 months ago

All jetbrains IDEs (including DataGrip, etc) have a jdbc.RedisDriver. The Redis Driver lists the "Sets" together with the "SRANDMEMBER" command. Since it does not yet exist, unfortunately the "Sets" are not visible in the GUI or IDE and an error message also appears.

It would be great if you could add SRANDMEMBER so that the listing and the contents of the SETS are also displayed (and no more error messages appear).

Bildschirmfoto 2023-11-06 um 14 17 47

P.S "Sorted Sets" work, but the support of "ZRANDMEMBER" would also be great :-)

Thank you :-)

romange commented 11 months ago

I suggest that this command will just return count first items while iterating over set. Randomness is not really needed here.

admtech commented 11 months ago

I suggest that this command will just return count first items while iterating over set. Randomness is not really needed here.

Of course, that would be enough for the error above. I can live with that for now :-)

Is it harder to return a simple randomised list? With the full implementation, this could be checked in the Dragonfly API compatibility.

romange commented 11 months ago

The fact the nobody asked for it before means they are not used in prod and for GUI usecase returning the first k is enough. We will improve if required.

romange commented 11 months ago

@BorysTheDev please also implement ZRANDMEMBER as well