成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

還在手動整理數據庫文檔?試試這個工具

運維 數據庫運維
在企業級開發中、我們經常會有編寫數據庫表結構文檔的時間付出,從業以來,待過幾家企業,關于數據庫表結構文檔狀態:要么沒有、要么有、但都是手寫、后期運維開發,需要手動進行維護到文檔中,很是繁瑣。

 [[335513]]

 

簡介

在企業級開發中、我們經常會有編寫數據庫表結構文檔的時間付出,從業以來,待過幾家企業,關于數據庫表結構文檔狀態:要么沒有、要么有、但都是手寫、后期運維開發,需要手動進行維護到文檔中,很是繁瑣、如果忘記一次維護、就會給以后工作造成很多困擾、無形中制造了很多坑留給自己和后人,于是需要一個插件工具screw[1]來維護。

screw 特點

  • 簡潔、輕量、設計良好。不需要 powerdesigner 這種重量的建模工具
  • 多數據庫支持 。支持市面常見的數據庫類型 MySQL、Oracle、SqlServer
  • 多種格式文檔。支持 MD、HTML、WORD 格式
  • 靈活擴展。支持用戶自定義模板和展示樣式

支持數據庫類型

  • [✔️] MySQL
  • [✔️] MariaDB
  • [✔️] TIDB
  • [✔️] Oracle
  • [✔️] SqlServer
  • [✔️] PostgreSQL
  • [✔️] Cache DB

依賴

這里以 mysql8 數據庫為例子

  1. <!--數據庫文檔核心依賴--> 
  2.  <dependency> 
  3.      <groupId>cn.smallbun.screw</groupId> 
  4.      <artifactId>screw-core</artifactId> 
  5.      <version>1.0.2</version> 
  6.  </dependency> 
  7.  <!-- HikariCP --> 
  8.  <dependency> 
  9.      <groupId>com.zaxxer</groupId> 
  10.      <artifactId>HikariCP</artifactId> 
  11.      <version>3.4.5</version> 
  12.  </dependency> 
  13.  <!--mysql driver--> 
  14.  <dependency> 
  15.      <groupId>mysql</groupId> 
  16.      <artifactId>mysql-connector-java</artifactId> 
  17.      <version>8.0.20</version> 
  18.  </dependency> 

1. 通過自定義代碼配置文檔生成

 

  1. @Test 
  2. public void shouldAnswerWithTrue() { 
  3.     //數據源 
  4.     HikariConfig hikariConfig = new HikariConfig(); 
  5.     hikariConfig.setDriverClassName("com.mysql.cj.jdbc.Driver"); 
  6.     hikariConfig.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/test"); 
  7.     hikariConfig.setUsername("root"); 
  8.     hikariConfig.setPassword("root"); 
  9.     //設置可以獲取tables remarks信息 
  10.     hikariConfig.addDataSourceProperty("useInformationSchema""true"); 
  11.     hikariConfig.setMinimumIdle(2); 
  12.     hikariConfig.setMaximumPoolSize(5); 
  13.     DataSource dataSource = new HikariDataSource(hikariConfig); 
  14.     //生成配置 
  15.     EngineConfig engineConfig = EngineConfig.builder() 
  16.             //生成文件路徑 
  17.             .fileOutputDir("/Users/lengleng"
  18.             //打開目錄 
  19.             .openOutputDir(true
  20.             //文件類型 
  21.             .fileType(EngineFileType.HTML) 
  22.             //生成模板實現 
  23.             .produceType(EngineTemplateType.freemarker).build(); 
  24.  
  25.     //忽略表 
  26.     ArrayList<String> ignoreTableName = new ArrayList<>(); 
  27.     ignoreTableName.add("test_user"); 
  28.     ignoreTableName.add("test_group"); 
  29.     //忽略表前綴 
  30.     ArrayList<String> ignorePrefix = new ArrayList<>(); 
  31.     ignorePrefix.add("test_"); 
  32.     //忽略表后綴 
  33.     ArrayList<String> ignoreSuffix = new ArrayList<>(); 
  34.     ignoreSuffix.add("_test"); 
  35.     ProcessConfig processConfig = ProcessConfig.builder() 
  36.             //忽略表名 
  37.             .ignoreTableName(ignoreTableName) 
  38.             //忽略表前綴 
  39.             .ignoreTablePrefix(ignorePrefix) 
  40.             //忽略表后綴 
  41.             .ignoreTableSuffix(ignoreSuffix).build(); 
  42.     //配置 
  43.     Configuration config = Configuration.builder() 
  44.             //版本 
  45.             .version("1.0.0"
  46.             //描述 
  47.             .description("數據庫設計文檔生成"
  48.             //數據源 
  49.             .dataSource(dataSource) 
  50.             //生成配置 
  51.             .engineConfig(engineConfig) 
  52.             //生成配置 
  53.             .produceConfig(processConfig).build(); 
  54.     //執行生成 
  55.     new DocumentationExecute(config).execute(); 

2. 通過插件的形式生成文檔

  1. <build> 
  2.     <plugins> 
  3.         <plugin> 
  4.             <groupId>cn.smallbun.screw</groupId> 
  5.             <artifactId>screw-maven-plugin</artifactId> 
  6.             <version>1.0.2</version> 
  7.             <dependencies> 
  8.                 <!-- HikariCP --> 
  9.                 <dependency> 
  10.                     <groupId>com.zaxxer</groupId> 
  11.                     <artifactId>HikariCP</artifactId> 
  12.                     <version>3.4.5</version> 
  13.                 </dependency> 
  14.                 <!--mysql driver--> 
  15.                 <dependency> 
  16.                     <groupId>mysql</groupId> 
  17.                     <artifactId>mysql-connector-java</artifactId> 
  18.                     <version>8.0.20</version> 
  19.                 </dependency> 
  20.             </dependencies> 
  21.             <configuration> 
  22.                 <!--username--> 
  23.                 <username>root</username> 
  24.                 <!--password--> 
  25.                 <password>root</password
  26.                 <!--driver--> 
  27.                 <driverClassName>com.mysql.cj.jdbc.Driver</driverClassName> 
  28.                 <!--jdbc url--> 
  29.                 <jdbcUrl>jdbc:mysql://127.0.0.1:3306/test</jdbcUrl> 
  30.                 <!--生成文件類型--> 
  31.                 <fileType>HTML</fileType> 
  32.                 <!--文件輸出目錄--> 
  33.                 <fileOutputDir>/Users/lengleng</fileOutputDir> 
  34.                 <!--打開文件輸出目錄--> 
  35.                 <openOutputDir>false</openOutputDir> 
  36.                 <!--生成模板--> 
  37.                 <produceType>freemarker</produceType> 
  38.                 <!--描述--> 
  39.                 <description>數據庫文檔生成</description> 
  40.                 <!--版本--> 
  41.                 <version>${project.version}</version> 
  42.                 <!--標題--> 
  43.                 <title>數據庫文檔</title> 
  44.             </configuration> 
  45.             <executions> 
  46.                 <execution> 
  47.                     <phase>compile</phase> 
  48.                     <goals> 
  49.                         <goal>run</goal> 
  50.                     </goals> 
  51.                 </execution> 
  52.             </executions> 
  53.         </plugin> 
  54.     </plugins> 
  55. </build> 

 

責任編輯:華軒 來源: JAVA架構日記
相關推薦

2020-12-21 09:40:16

數據庫工具技術

2023-12-10 13:58:17

2023-04-18 18:22:31

開源工具數據庫

2020-12-24 10:20:43

文檔工具語言

2022-02-09 07:44:30

Go源碼工具

2022-01-26 07:18:57

工具GoGo 項目

2011-03-07 17:02:07

2019-07-12 08:37:22

DockerNginx程序員

2019-04-08 14:58:36

數據庫SQL數據類型

2011-05-19 13:25:12

Oracle數據庫碎片

2023-03-29 07:02:46

開源項目工具

2023-02-01 10:40:01

2021-06-24 16:18:03

Cube.js數據分析開源

2011-05-13 13:54:02

數據庫文檔數據庫

2019-12-19 16:10:36

前端開發刷新頁面自動刷新

2024-10-28 16:31:03

2019-11-06 14:13:55

開發者技能工具

2025-04-18 10:14:29

2021-10-26 10:15:34

Python股市代碼

2022-09-19 07:06:03

SQL代碼編輯器
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 成人深夜福利在线观看 | 欧美中文字幕一区二区三区亚洲 | 日韩欧美在线观看视频网站 | 亚洲一区二区三区久久久 | 日本一区二区三区在线观看 | 国产精品国产三级国产aⅴ原创 | 色综久久| 日韩精品成人一区二区三区视频 | 欧美三级视频在线观看 | 久久99深爱久久99精品 | 99这里只有精品视频 | 日韩资源 | 成人欧美一区二区三区视频xxx | 亚洲网站在线观看 | 婷婷精品 | 免费永久av| 91 视频网站 | 日韩欧美精品一区 | 中文字幕精品一区二区三区在线 | 久久一区二区av | av中文字幕在线 | 亚洲一区二区在线视频 | 欧美九九 | 999观看免费高清www | 国产亚洲精品成人av久久ww | 国产女人叫床高潮大片免费 | 欧美一区二区在线观看 | 免费在线观看黄网站 | 国产亚洲精品美女久久久久久久久久 | 九九久久精品视频 | 欧美性受 | 午夜电影福利 | 视频一区中文字幕 | 日韩成人在线一区 | 影视一区| 国产乱码精品一区二区三区忘忧草 | 九九热免费在线观看 | 国产a区| 久久网站免费视频 | 久久99视频| 欧美精品在线播放 |