Java library to partially export a database while respecting referential integrity constraints
- by Mwanji Ezana
My production database is several GB's uncompressed and it's getting to be a pain to download and run locally when trying to reproduce a bug or test a feature with real data.
I would like to be able to select the specific records that interest me, then have the library figure out what other records are necessary to produce a dataset that respects the databases integrity constraints and finally print it out as a list of insert statements or dump that I can restore.
For example:
given Author, Blog and Comment tables
when I select comments posted after a certain date
I should get inserts for the Blog records the comments have foreign keys to and the Author records those Blogs have foreign keys to.