djveremix / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

[Feature Reqeust] Generic pretty printer for all key types #301

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'd imagine this is very useful in debugging or introspection, but not 
day-to-day things.

Similar to Ruby's p/pp methods, a generic command that will take a name of a 
key as a parameter and output some human friendly (ish?) form of the value of 
the key. Like sets could have all the elements comma separated, the entire 
string surrounded by '[]'.

Again, mostly for debugging, in order to confirm that the program is saving 
data correctly, without having to remember what type it is supposed to be and 
then using the correct command (GET vs HGET vs ZRANGE vs ...)

Original issue reported on code.google.com by colin.p....@gmail.com on 6 Aug 2010 at 3:40

GoogleCodeExporter commented 8 years ago
what's wrong with the output of redis-cli? :)

Original comment by anti...@gmail.com on 6 Aug 2010 at 6:04

GoogleCodeExporter commented 8 years ago
Nothing is wrong with the output, but really, it's just remembering all the 
different commands.

It would be much easier to have one command that printed the contents of a key 
regardless of the type. It can even use the same style redis-cli uses, I just 
don't want to have to remember if my target key is a ZRANGE, HASH or whatever 
else. :)

Original comment by colin.p....@gmail.com on 9 Aug 2010 at 2:48

GoogleCodeExporter commented 8 years ago
This makes sense to me, but I think this is something to add to redis-cli 
directly, and not a special command.

Redis-cli can just call TYPE and then the right function for the work.

I'll try to hack a patch today and report here.

Cheers,
Salvatore

Original comment by anti...@gmail.com on 30 Aug 2010 at 10:27

GoogleCodeExporter commented 8 years ago
With the current redis-cli internals this is too much an hack... I guess it's 
better to port it to hiredis C lib and then  enhance it with features like this 
one...

Taking the issue open, changing the labels from defect to enhancement.

Original comment by anti...@gmail.com on 30 Aug 2010 at 10:49

GoogleCodeExporter commented 8 years ago
I'd love this too, it's annoying to have to remember that for sets it's 
"smembers xxx", for list it's "lrange xxx 0 somebignumber" etc. and just have 
one command (print?) that prints entire value, whatever it is.

Original comment by jakub.su...@gmail.com on 18 Oct 2010 at 11:45