根据主表上的选择部分导出数据库表
为了适应大型批处理系统中的测试,我希望能够从许多处于“主 - 详细信息”关系的表中导出数据,即它们通过外键连接。我知道我可以通过 DBUnit 以编程方式做到这一点。 是否有任何框架/实用程序/工具可以让我定义表关系(例如,表a是通过外键b.1的表b的主表,通过外键c.1的表c是表c),然后给出主表的条件table (... where a.attribute = 'someCriteria') 和该工具导出所有连接的数据,并让我将数据导入到另一个数据库上(因此我拥有源表的一致数据子集)。
任何提示表示赞赏。谢谢。
to accomodate testing in a large batch system I would like to have the possibility to export data from many tables that are all in a "master - detail" relationship, i.e. they are connected via foreign keys. I know I can do that programmatically via DBUnit for example.
Is there any framework / utility / tool for which I can just define the tabel relationships (e.g. table a is master for table b via foreign key b.1 and table c via foreign key c.1) and then give a condition for the master table (... where a.attribute = 'someCriteria') and the tool exports all connected data and lets me import the data on another database (thus I have a consistent subset of data of the source tables).
Any hints are appreciated. Thx.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用Jailer,这是一个完全可以满足您需要的工具。
它有一个 GUI 和一个命令行实用程序。
You would use Jailer, a tool that do exactly what you need.
It has a GUI and a command line utilty.
如果您用来浏览数据库的工具能够导出查询结果,您只需执行三个查询的结果:
If the tool you use to browse your database is able to export results of a query, you just have to execute the result of three queries: