On Apr 24, 2012, at 3:33 AM, Stefan Urbanek wrote: > Hi, > > How can I get a string that is going to be executed without executing it? > > Example code: > > from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String > > engine = create_engine("sqlite://") > metadata = MetaData(engine) > > table = Table("foo", metadata) > table.append_column(Column("id", Integer)) > table.append_column(Column("name", String)) > > > Now I would like to get the "CREATE TABLE ..." string that I would like to > store/use somewhere else. > > How can I do that? > > Thanks for any hints,
the FAQ has the full details on the several ways you might go about this: http://www.sqlalchemy.org/trac/wiki/FAQ#HowcanIgettheCREATETABLEDROPTABLEoutputasastring -- 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.