On Aug 14, 2012, at 4:40 AM, Vlad K. wrote: > On 08/13/2012 10:13 PM, Michael Bayer wrote: >> we can keep turning the crank here, here's a full series of examples to make >> this happen: > > Thanks for the example, that's definitely something I'll need sooner or > later, already implemented my own PostgreSQL POINT data type and was > wondering how to use compile properly. > > But I was also wondering how to bind variables into a query (using the > sqlalchemy.orm.query.Query object on the session) without stuffing them in > the string, for a quick and dirty solution. Query.params() to the rescue: > > > rows = session.query(Model)\ > .filter(text("array_column @> ARRAY[:element_value]"))\ > .params(element_value='1234') > > > I suppose this is valid usage, I mean the query works as expected.
yeah or do that, sure ! -- 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.