On Jun 10, 2013, at 10:45 AM, Charlie Clark <[email protected]> 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 currently hardcoded and which I like > to move to SQL expressions to try and avoid inconsistencies between MySQL and > Postgres. Is this actually possible? I guess I should add that I have > different configurations for the app and housekeeping so that I cannot bind > the engine to classes in the way described in the SQL Expression > documentation. > > What is the best way to do this so that I have access to .insert(), .update() > for my models? 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 want there. Anything with an execute() on it, you can send an insert()/update() etc. into. The issue is the SQL expressions themselves? MyClass.__table__ is the Table, it has insert(), update(), all that. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
