there's a tuple_() operator:

http://www.sqlalchemy.org/docs/core/expression_api.html?highlight=tuple_#sqlalchemy.sql.expression.tuple_

the object returns is  _Tuple.   if you wanted fancy per-dialect expression 
behavior, mmm tricky, you'd need to subclass _Tuple (or write a new object), 
intercept comparisons like __eq__(), then return *another* construct that 
represents a "Tuple Comparison", and that object would need per-dialect 
compilation rules.

or you could lobby the sqlite folks to add support for the construct in the 
first place.    though i doubt SQL Server has it either.



On Apr 18, 2011, at 4:57 PM, bukzor wrote:

> SQL-92 defines a "row value constructor" expression like "(1,2,3)"
> which looks and behaves exactly like a Python tuple, as far as I can
> tell. These are implemented correctly in mysql at least, and I believe
> PostgreSQL and Oracle as well, although I don't have access to those
> systems.
> 
> What would be the best way to deal with this type of value in
> SQLAlchemy?
> Should I create a RowValue class which can be visited by the various
> dialects?
> 
> If I wanted to provide emulation for dialects which don't directly
> support this standard, what would be the way to go?
> For example, I'd like to be able to expand "RowValue((1,2)) >=
> RowValue(colA, colB)" to "1 > colA or (1=colA and 2 >= ColB)" under
> sqlite.
> 
> --Buck
> 
> -- 
> 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.
> 

-- 
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