Java library to partially export a database while respecting referential integrity constraints
Posted
by Mwanji Ezana
on Stack Overflow
See other posts from Stack Overflow
or by Mwanji Ezana
Published on 2010-03-08T09:01:48Z
Indexed on
2010/03/08
9:06 UTC
Read the original article
Hit count: 256
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.
© Stack Overflow or respective owner