python an sqlite objects

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Wed Dec 3 12:08:09 EST 2008


skip at pobox.com a écrit :
>     azrael> is it possible to save a python object into a sqlite database as
>     azrael> an atribute of type BLOB
> 
> Sure.  Just pickle the object and save the resulting string.
> 
Or if you want something more portable, serialize the object to json. At 
least you'll have a chance to deserialize it with some other language.

<mode="purist-well-almost">
Now note that using a RDBMS that way kind of defeats the whole point of 
using a RDBMS. I don't mean that it's _always_ a bad idea - there are a 
couple use case where it's probably the "less worse" thing to do -, but 
that one should think twice before doing so.
</mode>



More information about the Python-list mailing list