Re: [sqlalchemy] Re: SQLAlchemy 0.5.5 MySQL Issue

2009-11-28 Thread Alexandre Conrad
You may be using MyISAM storage engine which doesn't support transactions and may make all flushes persistent. The other storage engine widely used is InnoDB which does support transactions. Find out in the MySQL docs how to figure out which storage engine you're using. Sent from my fantastic HTC

Re: [sqlalchemy] Functions on results of subquery question

2009-11-28 Thread Mike Conley
On Fri, Nov 27, 2009 at 10:55 AM, Oliver Beattie oli...@obeattie.comwrote: Hey there, I'm probably missing something here, but no matter what I try, I can't seem to find a way to translate this query into SQLAlchemy code: SELECT AVG(sub.average) FROM ( SELECT

[sqlalchemy] extra where on orm updates with error checking

2009-11-28 Thread kindly
Is there a way of, with every orm update to add extra conditions to the where clause and to check (and rollback if fail) that the row that was supposed to be updated actually was. i.e user = session.query(User).get(4) ## id of 4 user.name = fred ## a change to user name session.add(user)

Re: [sqlalchemy] extra where on orm updates with error checking

2009-11-28 Thread Michael Bayer
On Nov 28, 2009, at 10:25 AM, kindly wrote: Is there a way of, with every orm update to add extra conditions to the where clause and to check (and rollback if fail) that the row that was supposed to be updated actually was. i.e user = session.query(User).get(4) ## id of 4 user.name =

[sqlalchemy] SQL IF in sqlalchemy?

2009-11-28 Thread Diego Woitasen
Does sqlalchemy support SQL IF? For example: select date, if(proxy_user_id 1, count(distinct address_id), 0) from table group by date; I've solved this using literal SQL in Query() parameters but may be I can do it using ORM. -- Diego Woitasen XTECH -- You received this message because you

Re: [sqlalchemy] SQL IF in sqlalchemy?

2009-11-28 Thread Michael Bayer
we support CASE via case() which will get you there just as well. On Nov 28, 2009, at 1:54 PM, Diego Woitasen wrote: Does sqlalchemy support SQL IF? For example: select date, if(proxy_user_id 1, count(distinct address_id), 0) from table group by date; I've solved this using literal SQL