一 前言
本文介紹一些比較流行的數據庫文檔生成工具,什么是數據庫文檔? 其實在工作中進行項目交付的時候經常用到;簡單來說數據庫文檔就是對整個數據庫設計說明的文檔,比如使用了哪個數據庫,每張表的字段,類型說明等,然后整理成一個設計文檔,這個文檔多種多樣,最常見的就是word,有了數據庫文檔對以后的數據庫維護,或者進行二次開發都很方便;
二 流行的數據庫文檔生成工具
2.1 screw
最近比較火的一款數據庫文檔生成工具目前支持如下幾種數據庫,其它還在開發中
- MySQL
- MariaDB
- TIDB
- Oracle
- SqlServer
- PostgreSQL
- Cache DB
文檔生成支持
文檔生成支持
- html
- word
- markdwon
生成示例
使用方式 支持 java ,和 maven 插件, java方式看官方文檔;
<build>
<plugins>
<plugin>
<groupId>cn.smallbun.screw</groupId>
<artifactId>screw-maven-plugin</artifactId>
<version>${lastVersion}</version>
<dependencies>
<!-- HikariCP -->
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.4.5</version>
</dependency>
<!--mysql driver-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.20</version>
</dependency>
</dependencies>
<configuration>
<!--username-->
<username>root</username>
<!--password-->
<password>password</password>
<!--driver-->
<driverClassName>com.mysql.cj.jdbc.Driver</driverClassName>
<!--jdbc url-->
<jdbcUrl>jdbc:mysql://127.0.0.1:3306/xxxx</jdbcUrl>
<!--生成文件類型-->
<fileType>HTML</fileType>
<!--打開文件輸出目錄-->
<openOutputDir>false</openOutputDir>
<!--生成模板-->
<produceType>freemarker</produceType>
<!--文檔名稱 為空時:將采用[數據庫名稱-描述-版本號]作為文檔名稱-->
<fileName>測試文檔名稱</fileName>
<!--描述-->
<description>數據庫文檔生成</description>
<!--版本-->
<version>${project.version}</version>
<!--標題-->
<title>數據庫文檔</title>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
項目地址: https://gitee.com/leshalv/screw
2.2 DBCHM
DBCHM 支持SqlServer/MySQL/Oracle/PostgreSQL/DB2/SQLite數據庫。
支持的導出的文件格式;
- chm
- word
- excel
- html
- xml
- markdown
效果展示
最新版本示 DBCHM.exe 軟件,上手也容易;
項目地址:https://gitee.com/lztkdr/DBCHM
2.3 TableGo
TableGo是基於數據庫的代碼自動生成工具,低代碼編程技術的實現,可以零代碼自動生成SpringBoot項目工程、生成JavaBean、生成MyBaits的Mapper映射配置文件、生成數據庫設計文檔(Word、Excel)、生成Swagger2離線API文檔、生成前后端代碼、能查出數據庫數據生成各種代碼和文檔等;
支持MySQL、Oracle、SQL Server、PostgreSQL、MariaDB五種數據庫;
使用自定義模板功能可以根據數據庫表結構信息生成你想要的任何代碼,例如:Java、C#、C++、Golang、Rust、Python、Objective-C、Swift、VB、VC、SQL、HTML、JSP、JS、PHP、Vue、React、Word、Excel等;
界面展示:
詳細介紹地址:https://blog.csdn.net/vipbooks/article/details/78767469
求關注關注吖