assuming this is the same thing asked on reddit: http://www.reddit.com/r/Python/comments/p5grh/sqlalchemy_whats_the_idiomatic_way_of_writing/
I mentioned ticket #960 as where we'd someday support "MERGE" and its variants, but this can also be rolled with @compiles, see the example in that ticket. http://www.sqlalchemy.org/trac/ticket/960 On Jan 31, 2012, at 11:32 PM, Didip Kerabat wrote: > when using SqlAlchemy Core (not using Session/ORM)? > > I have quite a few tables with composite primary keys that can use it > for optimization. > > At the moment what I have is quite ghetto, below is a contrive example > of it: > > stmt = str(user_table.insert().values(email=email, name=name)) > stmt += " ON DUPLICATE KEY UPDATE name=%s" > engine.execute(stmt, email, name, name) > > NOTE: I believe this is MySQL specific. > > -- > 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. > -- 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.