> -----Original Message-----
> From: sqlalchemy@googlegroups.com 
> [mailto:sqlalch...@googlegroups.com] On Behalf Of Faheem Mitha
> Sent: 27 January 2009 22:41
> To: sqlalchemy@googlegroups.com
> Subject: [sqlalchemy] the return type of conn.execute(text(""))
> 
> 
> 
> Hi,
> 
> Today I attempted to serialize the return value of the form
> 
> result = conn.execute(text(""))
> 
> Till now I thought that the return type was a list of tuples, 
> while in 
> fact it is a list of objects of type <class 
> 'sqlalchemy.engine.base.RowProxy'>. Hence cPickle refused to 
> serialize 
> till I did some conversion.
> 
> Just wondering what the reason for this is.
> 
>                             Regards, Faheem.
> 

The RowProxy object is more intelligent than a plain tuple. As well as
accessing the values by index, you can use your original column objects
or the name of the column to retrieve the values from it. You can also
use attribute access rather than indexing.

Eg.

row['your_column_name']
row[your_column]
row.your_column_name

I imagine this would make it harder to pickle.

Simon

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

Reply via email to