Ed Singleton wrote: > class InsertFromSelect(ClauseElement): > def __init__(self, table, select): > self.table = table > self.select = select > > @compiles(InsertFromSelect) > def visit_insert_from_select(element, compiler, **kw): > return "INSERT INTO %s (%s) %s" % ( > compiler.process(element.table, asfrom=True), > ", ".join([col.name for col in element.select.columns]), > compiler.process(element.select), > ) >
add the mixin sqlalchemy.sql.expression._Executable to your InsertFromSelect class. I'm going to rename it to "Executable" and will add it to the docs now. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.