现有数据库生成数据库文档的工具有哪些?

2023-12-14 09:43:12 +08:00
 NeverBelieveMe

要对一堆乱七八糟的数据库进行文档整理,实在是头大。有没有能快速生成文档的工具。

2074 次点击
所在节点    程序员
14 条回复
ash1n2
2023-12-14 09:49:52 +08:00
draw.io 把导出的表结构自动转换成 er 图?
815979670
2023-12-14 09:50:05 +08:00
我之前写过一个 php 脚本,读取数据库表结构生成 markdown 的,https://www.dbkuaizi.com/archives/97.html
NeverBelieveMe
2023-12-14 09:50:40 +08:00
@ash1n2 想要的是 word 文档。
SmartTom
2023-12-14 09:58:07 +08:00
orisine
2023-12-14 09:58:52 +08:00
Dongxiaohao
2023-12-14 10:00:41 +08:00
@NeverBelieveMe 我记得 Java 这边是专门有工具类 直接生成 word 文档 里面会把字段的注释 名字类型什么的都写出来
orisine
2023-12-14 10:01:45 +08:00
@orisine 回复完发现楼上已经发了,PDM 也可以导出 RTF
luobingit
2023-12-14 10:13:56 +08:00
码猴.PDMReader
lenmore
2023-12-14 11:48:21 +08:00
MySQL 可以试下这个,以前写的应付检查的……
导出成 excel ,去掉表头就行了。

SET @table_schema='test';

SELECT column_name, DATA_TYPE, COLUMN_COMMENT
FROM (
SELECT table_name, '' AS column_name, '' AS DATA_TYPE, '' AS COLUMN_COMMENT, -4 AS ORDINAL_POSITION FROM information_schema.tables WHERE table_schema=@table_schema
UNION
SELECT table_name, CONCAT('表名:', table_name) AS column_name, '' AS DATA_TYPE, '' AS COLUMN_COMMENT, -3 AS ORDINAL_POSITION FROM information_schema.tables WHERE table_schema=@table_schema
UNION
SELECT table_name, CONCAT('用途:', table_comment) AS column_name, '' AS DATA_TYPE, '' AS COLUMN_COMMENT, -2 AS ORDINAL_POSITION FROM information_schema.tables WHERE table_schema=@table_schema
UNION
SELECT table_name, '字段名' AS column_name, '字段类型' AS DATA_TYPE, '描述' AS COLUMN_COMMENT, -1 AS ORDINAL_POSITION FROM information_schema.tables WHERE table_schema=@table_schema
UNION
SELECT table_name, column_name, CONCAT(DATA_TYPE, CASE WHEN CHARACTER_MAXIMUM_LENGTH IS NOT NULL THEN CONCAT('(', CHARACTER_MAXIMUM_LENGTH, ')') WHEN NUMERIC_PRECISION IS NOT NULL THEN CONCAT('(',NUMERIC_PRECISION, CASE WHEN NUMERIC_SCALE>0 THEN CONCAT(',',NUMERIC_SCALE) ELSE '' END , ')') WHEN DATETIME_PRECISION > 0 THEN CONCAT('(', DATETIME_PRECISION, ')') ELSE '' END) AS DATA_TYPE, COLUMN_COMMENT,ORDINAL_POSITION FROM information_schema.columns WHERE table_schema=@table_schema
) AS t
ORDER BY table_name, ORDINAL_POSITION;
wuyiccc
2023-12-14 11:51:53 +08:00
screw
canonlemon
2023-12-14 12:16:53 +08:00
PDManer ,可以逆向解析数据库,导出 Word 文档
ebony0319
2023-12-14 13:52:49 +08:00
@lenmore 好厉害
qiujianzhong
2023-12-14 23:39:51 +08:00
nerkeler
2023-12-16 23:29:44 +08:00
前两天也在找,找到个 database-export ,就是表多了就不好用了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1000238

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX