You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for inserting and retrieving picklable objects in Python #241
It would be very desirable to be able to work with objects that can pickle themselves without having to add wrapper code, and seems like an achievable feature.
IMO such extensions fit better into higher level libraries and not directly in the driver. Some users may want to explicitly serialize custom objects to JSON, or pickle, or other protocols.
We had a proposal for extending json with additional types which will eventually be implemented. The question then, is which python types would pickle, which ones would be coerced to native rethinkdb types, etc.
I'm moving to post-protobuf-improvements, let's discuss this when 1.4 is out. (I think doing something about this after 1.4 is a bit premature, but it'll become more clear then).
A different approach that could be very extensible is to allow drivers to register serializers/deserializers (in the way let's say Python's json/simplejson does it).
Activity
al3xandru commentedon Jan 18, 2013
IMO such extensions fit better into higher level libraries and not directly in the driver. Some users may want to explicitly serialize custom objects to JSON, or pickle, or other protocols.
coffeemug commentedon Jan 18, 2013
We had a proposal for extending json with additional types which will eventually be implemented. The question then, is which python types would pickle, which ones would be coerced to native rethinkdb types, etc.
I'm moving to post-protobuf-improvements, let's discuss this when 1.4 is out. (I think doing something about this after 1.4 is a bit premature, but it'll become more clear then).
al3xandru commentedon Jan 18, 2013
A different approach that could be very extensible is to allow drivers to register serializers/deserializers (in the way let's say Python's json/simplejson does it).
alexbw commentedon Jan 18, 2013
This is the extension style that MongoDB provides.
http://api.mongodb.org/python/current/examples/custom_type.html
You write a custom serializer/deserializer and register it with a database. I've used that in the past, and once set-up, works quite well.
al3xandru commentedon Jan 21, 2013
@alexbw ha... and I thought my idea was unique 😉
alexbw commentedon Jun 13, 2013
Any thoughts on this issue? Would be of enormous use to many people.
coffeemug commentedon Jun 14, 2013
I'll write up a concrete proposal for this shortly.
coffeemug commentedon Jun 14, 2013
Ok, I've opened a concrete proposal in #1016. I'm closing this issue, please follow #1016 for updates.