通过反向工程数据库生成E-R图 [英] Generate an E-R Diagram by reverse-engineering a database

查看:537
本文介绍了通过反向工程数据库生成E-R图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:最初这个问题是问PostgreSQL,但是,答案适用于几乎任何数据库有一个JDBC驱动程序,可以检测外键关联。






查询PostgreSQL数据字典的外键和表之间的关系非常简单,但是如何使用这些信息生成表之间的关系图?



有关可以执行此操作的工具的任何建议?



知道GraphVIZ / DOT 可以有用,但是,我不知道如何编写一个应用程序生成有向图.DOT文件。


< div是 graphviz 软件包的一部分,这是一个漂亮的酷/有用的工具。当然,你需要一些东西来生成graphviz的点文件。我过去曾使用过 SchemaSpy 一次或两次,但它的效果非常好,只要您定义了关系在数据库中。


Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost any database which has a JDBC driver that can detect foreign-key associations.


Querying PostgreSQL data dictionary for foreign-keys and relationship between tables is very straightforward, but how can I use that information to generate a graph of the relations between tables?

Any recommendations about tools that can do this?

EDIT: I know GraphVIZ/DOT can be useful, however, I don't know have any idea regarding how to code an app that would generate the directed graph .DOT file.

解决方案

Dot is part of the graphviz package, which is a pretty damn cool/useful tool. Of course, you'll need something to generate the dot files for graphviz. I've used SchemaSpy once or twice in the past, and it works pretty well, provided you have the relationships defined in the database.

这篇关于通过反向工程数据库生成E-R图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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