[This message has also been posted.]
On Wed, 28 Jan 2009 05:03:19 -0800 (PST), MikeCo <[email protected]> wrote:
>
> Doesn't this work?
>
> result = conn.execute('some select statement').fetchall()
>
> result will be a ResultProxy containing RowProxy's
>
> pickleable = [tuple(row) for row in result]

Yes, that is what I'm currently doing.

> Each tuple contains the column data in what should be a pickleable
> form. This will work for ints, strings, unicodes, etc. Not sure about
> datetime, but probably ok. If the column types themselves are complex
> and not pickleable, then all bets are off.
>
> Of course when you unpickle this, it will give back raw data not SA
> objects, you will have to reconstruct those at run time if you need
> them

Right. My desire was just to the stuff that was printed out to be
pickled, namely the list of tuples. Though, as you point out, it is
easy enough to do oneself, since fortunately the rowproxy coerces to a
tuple. I think having all the meta-information in the rowproxy objects
be pickled would be hard. No idea what issues there would be in doing
that.

                                                     Regards, Faheem.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to