Re: [sqlalchemy] further restricting a query provided as raw sql

2010-05-04 Thread Chris Withers
Michael Bayer wrote: Are the innards of in_ exposed anywhere for public consumption or should I avoid? from sqlalchemy.sql import column column(anything_you_want).in_(['a', 'b', 'c']) Thanks, that's exactly what I was looking for... Chris -- You received this message because you are

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-29 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: we have the in_() construct. It should be in the ORM and SQL expression tutorials: t1 = Table('mytable', metadata, Column('foo', String)) select([t1]).where(t1.c.foo.in_(['a', 'b', 'c'])) However, that requires table/column objects which I don't

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-28 Thread Chris Withers
Michael Bayer wrote: we have the in_() construct. It should be in the ORM and SQL expression tutorials: t1 = Table('mytable', metadata, Column('foo', String)) select([t1]).where(t1.c.foo.in_(['a', 'b', 'c'])) However, that requires table/column objects which I don't have. Are the innards

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-26 Thread Chris Withers
Michael Bayer wrote: Any serious ideas or should I just go sulk in the corner? you have to use IN, and you have to generate the SQL every time based on the number of values you'd like to put into the IN. Does SA have any helper code anywhere for this? Chris -- You received this message

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-26 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: Any serious ideas or should I just go sulk in the corner? you have to use IN, and you have to generate the SQL every time based on the number of values you'd like to put into the IN. Does SA have any helper code anywhere for this? we have the in_()

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-23 Thread Chris Withers
I can't reconcile your comment with mine... ...I want to limit the results returned to those matching a set of ids. This isn't about storing schemaless content ;-) Any serious ideas or should I just go sulk in the corner? Chris Michael Bayer wrote: yeah man , this is why we're all moving to

[sqlalchemy] further restricting a query provided as raw sql

2010-04-15 Thread Chris Withers
Hi All, I have a big set of queries provided as raw sql like: SELECT somestuff FROM somewhere WHERE some_date = :from_date AND some_date = :to_date That's fine, I just blat it at session.execute and provide from_date and to_date in the params dict. However, they now wany to supply

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-15 Thread Michael Bayer
you have to rewrite your SQL to support the number of values in the IN clause for each parameter set. On Apr 15, 2010, at 9:54 AM, Chris Withers wrote: Hi All, I have a big set of queries provided as raw sql like: SELECT somestuff FROM somewhere WHERE some_date = :from_date AND

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-15 Thread Chris Withers
Michael Bayer wrote: you have to rewrite your SQL to support the number of values in the IN clause for each parameter set. Hmm :'( While my code knows the number of values, they don't, and it may vary from when they write the SQL to when that SQL gets executed by my code... Chris -- You

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-15 Thread Michael Bayer
yeah man , this is why we're all moving to mongodb :) On Apr 15, 2010, at 10:46 AM, Chris Withers wrote: Michael Bayer wrote: you have to rewrite your SQL to support the number of values in the IN clause for each parameter set. Hmm :'( While my code knows the number of values,

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-15 Thread Mariano Mara
Excerpts from Chris Withers's message of Thu Apr 15 11:46:05 -0300 2010: Michael Bayer wrote: you have to rewrite your SQL to support the number of values in the IN clause for each parameter set. Hmm :'( While my code knows the number of values, they don't, and it may vary from when

RE: [sqlalchemy] further restricting a query provided as raw sql

2010-04-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Mariano Mara Sent: 15 April 2010 16:20 To: sqlalchemy Subject: Re: [sqlalchemy] further restricting a query provided as raw sql Excerpts from Chris Withers's message of Thu