Re: [sqlalchemy] [Q] Transform a select part of a query

2012-10-25 Thread Ladislav Lenart
Cool! That is what I was looking for. Thank you, Ladislav Lenart On 24.10.2012 20:00, Michael Bayer wrote: with_entities() will give you this: http://docs.sqlalchemy.org/en/rel_0_7/orm/query.html#sqlalchemy.orm.query.Query.with_entities On Oct 24, 2012, at 11:21 AM, Ladislav Lenart

Re: [sqlalchemy] query .all and .count return different results when used with a subquery

2012-10-25 Thread Michael Bayer
On Oct 24, 2012, at 9:35 PM, dnathe4th wrote: I'm having a problem related to this as well. Is it possible for a join to get tripped up in the de-dup process or is that guaranteed to only occur for the mapper entity I query on? I am getting the de-duping if I query on the mapped entity,

Re: [sqlalchemy] Full table scan using Oracle String indexes

2012-10-25 Thread Yann Gravrand
Hi, Having had the same problem as above, I would like to use the convert_unicode='force' flag at engine configuration level. It seems that String tests the value of convert_unicode at its own level as well as engine level, but it isn't the case for the 'force' value check : def

Re: [sqlalchemy] Full table scan using Oracle String indexes

2012-10-25 Thread David Moore
Hello, In line with what is required for Python 3, would it not make sense to insist across the board that bind values to sqlalchemy.String should be bytestrings and that bind values to sqlalchemy.Unicode should be unicode strings, converting if necessary? I don't think I understand why you

Re: [sqlalchemy] Full table scan using Oracle String indexes

2012-10-25 Thread Yann Gravrand
Le jeudi 25 octobre 2012 16:21:49 UTC+2, David Moore a écrit : Hello, Hi, In line with what is required for Python 3, would it not make sense to insist across the board that bind values to sqlalchemy.String should be bytestrings and that bind values to sqlalchemy.Unicode should be

Re: [sqlalchemy] Full table scan using Oracle String indexes

2012-10-25 Thread David Moore
Hi Yann, Sorry for the confusion - my email was musing about what I thought sqlalchemy should do, not what I thought you should do. The way we have solved this is using the cx_Oracle inputtypehandler hook. So we've overriden where the connection is created by sqlalchemy, and then used the

Re: [sqlalchemy] Full table scan using Oracle String indexes

2012-10-25 Thread Yann Gravrand
Le jeudi 25 octobre 2012 17:28:37 UTC+2, Michael Bayer a écrit : the convert_unicode=Force flag does this. documentation at http://docs.sqlalchemy.org/en/rel_0_7/core/types.html?highlight=unicode#sqlalchemy.types.String.__init__. Hi Michael, Did you read my original message ? It was about

Re: [sqlalchemy] Full table scan using Oracle String indexes

2012-10-25 Thread Michael Bayer
On Oct 25, 2012, at 11:58 AM, Michael Bayer wrote: I'd sooner do something like add some kind of event handler for types that allows some kind of cross-cutting behavior. here's a proposal for that, but for now, stick with custom type or inputtypehandler: