rediscala icon indicating copy to clipboard operation
rediscala copied to clipboard

Some ByteStringSerializer's don't have a corresponding ByteStringDeserializer

Open francisdb opened this issue 9 years ago • 4 comments

Is there a reason that for example ByteStringDeserializer[Long] is missing?

francisdb avatar Apr 08 '16 12:04 francisdb

Yes, because you can't write a ByteStringDeserializer[Long] for any ByteString.

etaty avatar Apr 08 '16 13:04 etaty

So why do you have a ByteStringDeserializer[Double] then, that one also does not work for any ByteString?

francisdb avatar Apr 08 '16 13:04 francisdb

Hum I see, you are right. DoubleRedis should/could be hidden? (It should be hidden as it is Redis specific) https://github.com/etaty/rediscala/blob/master/src/main/scala/redis/Converter.scala#L183-L193

etaty avatar Apr 08 '16 13:04 etaty

Honestly, I think you should just have deserialisers for all of the serialisers. Even if they might throw exceptions. Users can always opt for the String version if they want to be safe. Are you sure the RedisDouble is Redis specific? As far as I know there is no such thing as double in Redis. It's just parsing the jave Double#toString() output.

francisdb avatar Apr 08 '16 13:04 francisdb