Hello all, I'm working on a project for which I need to create sql files (the sort that you get from a database dump) without actually connecting to any database. The resulting code must be compatible with MySQL.
My first inclination was to write a bunch of functions that contain sql code templates and substitute dynamic values where needed. I then came across SQLAlchemy and wanted to see if could use it to make this task a little easier. So far I've been reading the documentation on meta data and running some tests. My guess is that I need to define the statements and compile them with MySQLDialect. This, however, doesn't seem to be working. I tried calling compile on a Table object with dialect set to MySQLDialect(). When the result is printed there is nothing there (probably because I have no idea what I'm doing :)). Can anyone provide some tips on whether what I'm trying to do is possible, and if so, what is the best way to go about it? Basically, the output files will be a combination of create database, create table, insert, and update statements. I should also mention that I'm using Python 2.6 on Windows. The latest stable MySQL-Python extension doesn't support 2.6, and there doesn't seem to be a test version available for Windows. Even if the database API was available, there is no database for me to connect to. The goal is to generate these files on the local machine without depending on any external resources. Eventually, it may be possible to execute this code directly on the database server, which is why I think using SQLAlchemy from the beginning would make that transition much easier. Thanks for any help. - Max --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
