要对一堆乱七八糟的数据库进行文档整理,实在是头大。有没有能快速生成文档的工具。
2
815979670 2023-12-14 09:50:05 +08:00 1
我之前写过一个 php 脚本,读取数据库表结构生成 markdown 的,https://www.dbkuaizi.com/archives/97.html
|
3
NeverBelieveMe OP @ash1n2 想要的是 word 文档。
|
4
SmartTom 2023-12-14 09:58:07 +08:00 1
|
5
orisine 2023-12-14 09:58:52 +08:00 1
|
6
Dongxiaohao 2023-12-14 10:00:41 +08:00 via Android
@NeverBelieveMe 我记得 Java 这边是专门有工具类 直接生成 word 文档 里面会把字段的注释 名字类型什么的都写出来
|
8
luobingit 2023-12-14 10:13:56 +08:00
码猴.PDMReader
|
9
lenmore 2023-12-14 11:48:21 +08:00 2
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; |
10
wuyiccc 2023-12-14 11:51:53 +08:00
screw
|
11
canonlemon 2023-12-14 12:16:53 +08:00 1
PDManer ,可以逆向解析数据库,导出 Word 文档
|
13
qiujianzhong 2023-12-14 23:39:51 +08:00
|
14
nerkeler 2023-12-16 23:29:44 +08:00 via Android
前两天也在找,找到个 database-export ,就是表多了就不好用了
|