Skip to content
This repository was archived by the owner on Jun 6, 2019. It is now read-only.

Commit a40e35f

Browse files
committed
update readme_cn.md
1 parent 5d09a32 commit a40e35f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

README_CN.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,17 @@ xorm 是一组数据库操作命令行工具。
3535
* **source** 从标注输入中执行SQL文件
3636
* **driver** 列出所有支持的数据库驱动
3737

38-
## reverse
38+
## 反转
3939

40-
Reverse command is a tool to convert your database struct to all kinds languages of structs or classes. After you installed the tool, you can type
40+
Reverse 命令让你根据数据库的表来生成结构体或者类代码文件。安装好工具之后,可以通过
4141

4242
`xorm help reverse`
4343

44-
to get help
44+
获得帮助。
4545

46-
example:
46+
例子:
47+
48+
首先要进入到当前项目的目录下,主要是后面的命令最后一个参数中用到的模版存放在当前项目的目录下
4749

4850
`cd $GOPATH/github.com/go-xorm/cmd/xorm`
4951

@@ -59,19 +61,19 @@ mymysql:
5961
postgres:
6062
`xorm reverse postgres "dbname=xorm_test sslmode=disable" templates/goxorm`
6163

62-
will generated go files in `./model` directory
64+
之后将会生成代码 generated go files in `./model` directory
6365

64-
### Template and Config
66+
### 模版和配置
6567

66-
Now, xorm tool supports go and c++ two languages and have go, goxorm, c++ three of default templates. In template directory, we can put a config file to control how to generating.
68+
当前,默认支持Go,C++ 和 objc 代码的生成。具体可以查看源码下的 templates 目录。在每个模版目录中,需要放置一个配置文件来控制代码的生成。如下:
6769

6870
```
6971
lang=go
7072
genJson=1
7173
```
7274

73-
lang must be go or c++ now.
74-
genJson can be 1 or 0, if 1 then the struct will have json tag.
75+
`lang` 目前支持 go, c++ 和 objc。
76+
`genJson` 可以为0或者1,如果是1则结构会包含json的tag,此项配置目前仅支持Go语言。
7577

7678
## Shell
7779

0 commit comments

Comments
 (0)