limpyd / redis-limpyd

Provide an easy way to store python objects in Redis, without losing the power and the control of the Redis API
https://redis-limpyd.readthedocs.org/
Do What The F*ck You Want To Public License
72 stars 11 forks source link

Fields with binary data? #141

Open dabbler0 opened 4 years ago

dabbler0 commented 4 years ago

Feature request: Right now limpyd initializes all Redis collections with decode_responses=True which makes it impossible to store raw binary data (which raw Redis can do, and is useful for things like images and audio). My workaround for this for the time being has been to fork limpyd, turn this off, and just decode things by hand when they are string values instead of binary values.

But in the longer term, it seems like it might make more sense to have two different kinds of fields, like a StringField and a BytesField, which are identical from Redis's perspective, but where StringField's getters are automatically decoded by limpyd, and BytesField's getters are not. Is this something that you might be interested in supporting in the future? Or is there already a way for limpyd to deal with binary data that I am missing?