xorm/xorm
商讯在线 46fe2ce87e 一、xorm反转工具bug修复:
1、xorm反转工具增加表前缀支持;
2、修正decimal(5, 2)类型中括号内出现空格导致解析出错的bug;
3、修正xorm解析工具在windows环境下,指定生成路径时model名获取不正确的bug
二、xorm对于数据字段类型为文本类型默认值为空白字符的情况下,生成的struct中default信息丢失的bug,已修正。

Signed-off-by: 商讯在线 <swhbox@foxmail.com>
2014-01-30 13:10:15 +08:00
..
templates 一、xorm反转工具bug修复: 2014-01-30 13:10:15 +08:00
.gopmfile bug fixed 2013-12-12 14:33:26 +08:00
README.md dos2unix format 2014-01-07 17:21:02 +08:00
c++.go replace tab to 4 spaces for all codes 2013-12-09 10:29:23 +08:00
cmd.go replace tab to 4 spaces for all codes 2013-12-09 10:29:23 +08:00
go.go 一、xorm反转工具bug修复: 2014-01-30 13:10:15 +08:00
lang.go replace tab to 4 spaces for all codes 2013-12-09 10:29:23 +08:00
reverse.go 一、xorm反转工具bug修复: 2014-01-30 13:10:15 +08:00
shell.go bug fixed 2013-12-12 14:33:26 +08:00
xorm.go bug fixed 2013-12-12 14:33:26 +08:00

README.md

xorm tools

xorm tools is a set of tools for database operation.

Install

go get github.com/lunny/xorm/xorm

and you should install the depends below:

Reverse

After you installed the tool, you can type

xorm help reverse

to get help

example:

sqlite: xorm reverse sqite3 test.db templates/goxorm

mysql: xorm reverse mysql root:@/xorm_test?charset=utf8 templates/goxorm

mymysql: xorm reverse mymysql xorm_test2/root/ templates/goxorm

postgres: xorm reverse postgres "dbname=xorm_test sslmode=disable" templates/goxorm

will generated go files in ./model directory

Template and Config

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.

lang=go
genJson=1
```

lang must be go or c++ now.
genJson can be 1 or 0, if 1 then the struct will have json tag.

## LICENSE

 BSD License
 [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/)