Hello, 

I'm looking or some direction on how to implement the SQL syntax when 
querying Postgres' composite types. In case you're unfamiliar: the 
composite types in Postgres are a type that contains attributes which are 
regular SQL types. The attribute to type relationship is similar to the 
column to table relationship (except there are no constraints on 
attributes). A table column can be this composite type. Psycopg2 implements 
this by instantiating a namedtuple on retrieval or accepting a namedtuple 
on update/insert (you can also use your own custom class). The saving and 
retrieval isn't a problem with SQLAlchemy, I just pass through the 
namedtuple to/from Psycopg2. 

What I need to implement is the SQL syntax for querying composite type 
attributes. Postgres allows this by using the syntax 
"(table_name.column_name).attribute_name = 'bleh'" or just 
"(column_name).attribute_name = 'bleh'" when a table identifier is not 
required. I'm not sure how to go about this because the sql generation 
needs to change the way the column name is output, would this require 
subclassing the ColumnClause? I think I just need to know where to override 
the behaviour of generating the qualified column name in statements.

Thanks,

Jason

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


Reply via email to