nim-lang / redis

Official redis wrapper for Nim.
Other
128 stars 35 forks source link

Set commands `SADD` and `SREM` accepting multiple `member` arguments #19

Open jorisbontje opened 4 years ago

jorisbontje commented 4 years ago

The set commands SADD and SREM accept multiple member arguments since Redis version 2.4; in nim's redis lib only the former is implemented via the sladd proc https://github.com/nim-lang/redis/blob/master/src/redis.nim#L843

For adding multiple member support for both I can see two ways about it: 1) Add an slrem proc next to the existing srem proc. This would be in line with the existing library, but creates another non-obvious function. 2) Change both sadd and srem to support both a string and seq[string] as members argument; deprecating / removing sladd.

What would be the preferred approach?

euantorano commented 4 years ago

I would prefer adding an slrem proc personally.

On Fri, 24 Apr 2020, at 12:57, Joris Bontje wrote:

The set commands SADD and SREM accept multiple member arguments since Redis version 2.4; in nim's redis lib only the former is implemented via the sladd proc https://github.com/nim-lang/redis/blob/master/src/redis.nim#L843

For adding multiple member support for both I can see two ways about it:

  1. Add an slrem proc next to the existing srem proc. This would be in line with the existing library, but creates another non-obvious function.
  2. Change both sadd and srem to support both a string and seq[string] as members argument; deprecating / removing sladd. What would be the preferred approach?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nim-lang/redis/issues/19, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFW24KYEG54HNPJQKP3G4DROF5CVANCNFSM4MQBEKZA.