badboy / rdb-rs

RDB parsing & dumping library and utility
https://rdb.fnordig.de/
MIT License
62 stars 17 forks source link

Add speedy hex-keys output option #15

Closed qix closed 8 years ago

qix commented 8 years ago

Consider this a request for comment, as I'm very new to rust and needed to get this working for a personal use case. There isn't an open source product that can easily/neatly extract binary keys out of a redis database, so whipped up this.

In any case there is a bug in your skip method that sometimes does not read the correct number of bytes even if they are available.

badboy commented 8 years ago

D'oh! For some reason I never saw that PR. Sorry about that.

I now fixed the skip issue. I'll take a look at your hexkeys thing later today.

badboy commented 8 years ago

Hm, the hex-keys formatter is quite limited. I'm not convinced this is the way to go. Formatters provided here should at least handle all keys + values. Also I'm not sure the should_read_objects method is a good idea. It should not be the formatters responsibility to decide what is read, it should just format what it is given.

For now I am closing this. But we should eventually get better support for arbitrary binary data.

Thanks for the PR though!