Java库部分导出数据库,同时遵守参照完整性约束 [英] Java library to partially export a database while respecting referential integrity constraints

查看:122
本文介绍了Java库部分导出数据库,同时遵守参照完整性约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的生产数据库是几GB未压缩的,当尝试重现错误或使用真实数据测试功能时,本地下载和运行会很麻烦。

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.
    • 推荐答案

      这看起来像你所寻找的 Jailer

      this looks like what you look for Jailer

      它从关系数据库导出一致的,完全不变的行集。

      It exports consistent, referentially intact row-sets from relational databases.

      这篇关于Java库部分导出数据库,同时遵守参照完整性约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆