[sqlalchemy] Using SQL Expressions with existing declarative_base tables

2013-06-10 Thread Charlie Clark
Hi, I've got an application that I'm currently porting from MySQL to Postgres. The application itself has model classes derived from declarative_base but I have some housekeeping scripts that are currently hardcoded and which I like to move to SQL expressions to try and avoid

Re: [sqlalchemy] Using SQL Expressions with existing declarative_base tables

2013-06-10 Thread Michael Bayer
On Jun 10, 2013, at 10:45 AM, Charlie Clark charlie.cl...@clark-consulting.eu wrote: Hi, I've got an application that I'm currently porting from MySQL to Postgres. The application itself has model classes derived from declarative_base but I have some housekeeping scripts that are

Re: [sqlalchemy] Using SQL Expressions with existing declarative_base tables

2013-06-10 Thread Charlie Clark
Hi Mike, Am 10.06.2013, 18:38 Uhr, schrieb Michael Bayer mike...@zzzcomputing.com: I'm not sure here where the pain point is for you, just how to get access to something.execute()? Session has execute(), Engines and Connections can be stuck onto Sessions, there's any combination you'd

Re: [sqlalchemy] Using SQL Expressions with existing declarative_base tables

2013-06-10 Thread Michael Bayer
On Jun 10, 2013, at 12:46 PM, Charlie Clark charlie.cl...@clark-consulting.eu wrote: Hi Mike, Am 10.06.2013, 18:38 Uhr, schrieb Michael Bayer mike...@zzzcomputing.com: I'm not sure here where the pain point is for you, just how to get access to something.execute()? Session has

Re: [sqlalchemy] Using SQL Expressions with existing declarative_base tables

2013-06-10 Thread Charlie Clark
Am 10.06.2013, 18:54 Uhr, schrieb Michael Bayer mike...@zzzcomputing.com: Page.__table__.update() Duh! Just didn't see that. or agnostic of declarative: from sqlalchemy import inspect pages = inspect(Page).local_table pages.update() That looks nicer to me, thanks. Charlie -- Charlie