On Apr 20, 2011, at 1:09 AM, bukzor wrote:

> Thanks Michael. I won't be using or supporting SQL Server, so I'm
> quite fine with that.
> 
> I guess the way forward would be to install SA in develop mode and
> make the changes directly?

no, to create your own SQL constructs use the compiler extension:

http://www.sqlalchemy.org/docs/core/compiler.html


> 
> Excuse my ignorance, but why would you do it that way?
> Since I don't want to change any of the functionality of _Tuple I
> wouldn't think a subclass would be necessary.
> Also, since comparison are already captured by _CompareMixin and
> represented as _BinaryExpression, I would have thought that
> intercepting the compilation of _BinaryExpression in the sqlite
> dialect would be the way to go.
> 
> --Buck
> 
> On Apr 19, 6:51 am, Michael Bayer <mike...@zzzcomputing.com> wrote:
>> there's a tuple_() operator:
>> 
>> http://www.sqlalchemy.org/docs/core/expression_api.html?highlight=tup...
>> 
>> 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 
>>> athttp://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.
> 

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