1
1
# Code Generator
2
- 此工具主要用于将[ Excel模板] ( template ) 文档转换为数据库结构、初始数据的sql脚本及多语言资源代码。
2
+
3
+ 此工具主要用于将[ Excel 模板] ( template ) 文档转换为数据库结构、初始数据的 sql 脚本及多语言资源代码。
3
4
4
5
## 主要功能
5
- * DDL - 生成数据库结构代码,支持 Mysql/SQLServer/SQLite
6
- * DML - 生成初始数据的sql代码
7
- * MSG - 生成多语言资源代码,支持 Android/IOS/JSON/Java/.NET
6
+
7
+ - DDL - 生成数据库结构代码,支持 Mysql/SQLServer/SQLite
8
+ - DML - 生成初始数据的 sql 代码
9
+ - MSG - 生成多语言资源代码,支持 Android/IOS/JSON/Java/.NET
8
10
9
11
## 安装
10
- ** Mac/Linux 用户**
12
+
13
+ ### Mac/Linux 用户
14
+
11
15
``` sh
12
16
/bin/bash -c " $( curl -fsSL https://raw.githubusercontent.com/excel-code-generator/code-generator/master/install.sh) "
13
17
```
18
+
14
19
> 将以上命令粘贴至终端。
15
20
16
- ** Windows 用户**
21
+ ### Windows 用户
22
+
17
23
``` ps1
18
24
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/excel-code-generator/code-generator/master/install.ps1'))
19
25
```
20
- > 将以上命令粘贴至PowerShell。
21
26
22
- ** 更新**
27
+ > 将以上命令粘贴至 PowerShell。
28
+
29
+ ### 更新
30
+
23
31
``` sh
24
32
cg update
25
33
```
34
+
26
35
> Windows/Mac/Linux 均相同。
27
36
28
- ## 在Docker中使用
37
+ ## 在 Docker 中使用
38
+
29
39
``` sh
30
40
docker pull yanglibing/code-generator
31
41
docker run --rm -it yanglibing/code-generator
32
42
```
33
43
34
44
## 参数说明
35
- ```
45
+
46
+ ``` text
36
47
用法:cg command file [options]
37
- Commands:
48
+ Commands:
38
49
update 检查并更新到最新版本
39
50
ddl.mssql 生成SqlServer数据库结构SQL脚本(.ddl)
40
51
ddl.mysql 生成MySql数据库结构SQL脚本(.ddl)
@@ -53,37 +64,40 @@ Options:
53
64
-s,--sheets <names> 要处理的Excel Sheet名,默认除"#"开头外的全部Sheet
54
65
-v,--version 打印版本信息
55
66
56
- 示例:
67
+ 示例:
57
68
cg msg.json 001.xlsx
58
69
cg msg.resx 001.xlsx --sheets Sheet1 Sheet2 Sheet5
59
70
60
- 帮助:
71
+ 帮助:
61
72
cg ddl.mysql --help 显示数生成据库结构的更多帮助信息
62
73
cg dml --help 显示生成初始数据的更多帮助信息
63
74
cg msg.json --help 显示生成国际化资源的更多帮助信息
64
75
65
76
通过 cg command --help 查看指定命令的详细说明。
66
77
67
78
---
68
- Code Generator v4.2 .0
79
+ Code Generator v4.3 .0
69
80
By https://yanglb.com
70
81
```
71
82
72
83
## 用法示例
84
+
73
85
``` sh
74
86
# 生成 MySql 数据库结构脚本
75
87
cg ddl.mysql database.xlsx --engine myisam
76
88
77
89
# 生成 JSON 多语言资源
78
90
cg msg.json msg.xlsx
79
91
```
80
- > Excel模板请参考 [ template] ( template )
92
+
93
+ > Excel 模板请参考 [ template] ( template )
81
94
82
95
## 升级说明
83
- 4.x版本不兼容老版本的命令行参数,但Excel模板在所有版本下均可正常使用。
96
+
97
+ 4.x 版本不兼容老版本的命令行参数,但 Excel 模板在所有版本下均可正常使用。
84
98
85
99
## License
86
100
87
- Copyright (c) 2015-2021 yanglb.com. All rights reserved.
101
+ Copyright (c) 2015-2023 yanglb.com. All rights reserved.
88
102
89
103
Licensed under the [ Apache License 2.0] ( LICENSE ) license.
0 commit comments