6 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: fully qualified colu...
FromSent OnAttachments
icct27 Nov 2007 00:03 
Michael Bayer27 Nov 2007 08:09 
Yuri Pimenov27 Nov 2007 08:30 
Michael Bayer27 Nov 2007 09:07 
King Simon-NFHD7827 Nov 2007 09:07 
Yuri Pimenov27 Nov 2007 14:20 
Subject:[sqlalchemy] Re: fully qualified column names in RowProxy
From:Michael Bayer (mike@zzzcomputing.com)
Date:11/27/2007 09:07:45 AM
List:com.googlegroups.sqlalchemy

On Nov 27, 2007, at 11:30 AM, Yuri Pimenov wrote:

Quote it.

oh right, duh, let me answer post-coffee next time....

SQLite is the reason for the truncation on the dot, and I got both test cases (i.e. using sqlite and you dont expect the dot, or using dot-separated labels and you do expect the dot) to be supported including with SQLite in r3836. My main concern, which is slowing down of ResultProxy, doesn't seem to be an issue here...if the dot isnt present (the majority of cases), the truncation doesnt occur now so that saves time in itself.

I've found 'use_labels' parameter in select(). Everything is good but it uses _ as separator between table and column. That makes things not so easy because it is common practice to use _ in table and column names. Why not to use . as separator?

an underscore is pretty portable and doesnt require quoting, making it easier to read and type. also underscore qualified labels are definitely the most common practice i have seen, using ORM like Hibernate and others... I have never seen a quoted "tablename.colname" label being used before (hence it tripped me up).

Also due to the sqlite issue, we necessarily have to perform a truncation step in the result if a dot is present in the colname, so if anything we gain speed by not standardizing that syntax.

My other blue sky dream is about ORM and unicode column names (python3.0?).

we support unicode column names and table names as well as the databases themselves do....just go browse through the unit tests in test/sql/unicode.py (there are others elsewhere). for ORM you need to redefine the mapped properties using ascii names (i.e. in the 'properties' dict) so you can access them.