自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

還在手動整理數(shù)據(jù)庫文檔?試試這個工具

運維 數(shù)據(jù)庫運維
在企業(yè)級開發(fā)中、我們經(jīng)常會有編寫數(shù)據(jù)庫表結(jié)構(gòu)文檔的時間付出,從業(yè)以來,待過幾家企業(yè),關(guān)于數(shù)據(jù)庫表結(jié)構(gòu)文檔狀態(tài):要么沒有、要么有、但都是手寫、后期運維開發(fā),需要手動進(jìn)行維護(hù)到文檔中,很是繁瑣。

 [[335513]]

 

簡介

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

screw 特點

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

支持?jǐn)?shù)據(jù)庫類型

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

依賴

這里以 mysql8 數(shù)據(jù)庫為例子

  1. <!--數(shù)據(jù)庫文檔核心依賴--> 
  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.     //數(shù)據(jù)源 
  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.     //設(shè)置可以獲取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.             //生成模板實現(xiàn) 
  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("數(shù)據(jù)庫設(shè)計文檔生成"
  48.             //數(shù)據(jù)源 
  49.             .dataSource(dataSource) 
  50.             //生成配置 
  51.             .engineConfig(engineConfig) 
  52.             //生成配置 
  53.             .produceConfig(processConfig).build(); 
  54.     //執(zhí)行生成 
  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>數(shù)據(jù)庫文檔生成</description> 
  40.                 <!--版本--> 
  41.                 <version>${project.version}</version> 
  42.                 <!--標(biāo)題--> 
  43.                 <title>數(shù)據(jù)庫文檔</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> 

 

責(zé)任編輯:華軒 來源: JAVA架構(gòu)日記
相關(guān)推薦

2020-12-21 09:40:16

數(shù)據(jù)庫工具技術(shù)

2023-12-10 13:58:17

2023-04-18 18:22:31

開源工具數(shù)據(jù)庫

2020-12-24 10:20:43

文檔工具語言

2022-01-26 07:18:57

工具GoGo 項目

2011-03-07 17:02:07

2019-07-12 08:37:22

DockerNginx程序員

2022-02-09 07:44:30

Go源碼工具

2019-04-08 14:58:36

數(shù)據(jù)庫SQL數(shù)據(jù)類型

2023-03-29 07:02:46

開源項目工具

2011-05-19 13:25:12

Oracle數(shù)據(jù)庫碎片

2021-06-24 16:18:03

Cube.js數(shù)據(jù)分析開源

2023-02-01 10:40:01

2011-05-13 13:54:02

數(shù)據(jù)庫文檔數(shù)據(jù)庫

2019-12-19 16:10:36

前端開發(fā)刷新頁面自動刷新

2019-11-06 14:13:55

開發(fā)者技能工具

2025-04-18 10:14:29

2024-10-28 16:31:03

2021-10-26 10:15:34

Python股市代碼

2022-09-19 07:06:03

SQL代碼編輯器
點贊
收藏

51CTO技術(shù)棧公眾號