uber / charlatan

A Python library to efficiently manage and install database fixtures
https://charlatan.readthedocs.org/en/latest/
Other
89 stars 12 forks source link

Possible to generate fixtures from database? #52

Open mattbennett opened 9 years ago

mattbennett commented 9 years ago

Charlatan seems like a very nice way to manage and load fixture data. Is it possible to go the other way, and generate fixtures from an existing database?

Django's fixture management lets you do this via manage.py dumpdata. It's a useful way to capture database state to something that's human readable/editable and less brittle than sqldump.

Thanks.

charlax commented 9 years ago

It's currently not possible to do this, but that's a great idea. The code to export the fixture would need to understand the mapping between the database data and the mapped object, which would be Django (or SQLAlchemy) specific.