I want to reflect a schema using SQLAlchemy's MetaData.reflect()
method, so that I can have a cache of the current schema. How can I do this?
views:
138answers:
1
+1
A:
A simple and supported way to cache the result of reflection is to just pickle the MetaData object. If you prefer to generate Python code that initializes the metadata, then there's a tool called sqlautocode.
Ants Aasma
2010-04-14 17:05:04
I've tried it; wow, does it ever NOT work properly with SQLAlchemy 0.6; I had to patch a bunch of its imports to make it work. It can be done, however.
Chris R
2010-04-14 17:31:22