On Thu, Apr 2, 2009, Maxim Khitrov <mkhit...@gmail.com> wrote: > > If using SQLAlchemy to create these dump files directly is not > possible, what about using reflection to load the schema for a given > database, recreating that schema in a temporary database, loading > required data, and then generating the SQL dump? > > I can do the first part of that like so: > > engine = create_engine('mysql://root:<password>@localhost/caffeine_gum2') > meta = MetaData() > meta.reflect(bind=engine)
Sounds good (although I am not familiar with reflection in SA :( ) > Once I have the metadata, how can I create a temporary database and > reload the table structure there? I suppose I'll need to use some > other tool for generating the dump once the data is inserted, but > that's fine. As long as I'm not modifying the live data I'll be happy. How about 'mysqldump database' ? You can use the '--compatible' option to generate an SQL dump that is compatible with mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb. Y. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---