update go mod
This commit is contained in:
@ -9,10 +9,9 @@ package sql2go
|
||||
|
||||
import (
|
||||
"errors"
|
||||
wrapperType "git.zhangdeman.cn/zhangdeman/wrapper"
|
||||
"strings"
|
||||
|
||||
"git.zhangdeman.cn/zhangdeman/util"
|
||||
|
||||
"github.com/xwb1989/sqlparser"
|
||||
)
|
||||
|
||||
@ -60,7 +59,7 @@ func ParseCreateTableSql(sql string, withGetTableFunc bool) (string, *BasicTable
|
||||
return "", nil, errors.New("input sql is not ddl")
|
||||
}
|
||||
basic.TableName = sqlparser.String(r.NewName)
|
||||
basic.ModelStruct = util.String.SnakeCaseToCamel(basic.TableName)
|
||||
basic.ModelStruct = wrapperType.String(basic.TableName).SnakeCaseToCamel()
|
||||
structResult := "type " + basic.ModelStruct + " struct { \n"
|
||||
|
||||
for _, item := range r.TableSpec.Columns {
|
||||
@ -71,7 +70,7 @@ func ParseCreateTableSql(sql string, withGetTableFunc bool) (string, *BasicTable
|
||||
comment = string(item.Type.Comment.Val)
|
||||
}
|
||||
data := map[string]string{
|
||||
"{FIELD}": util.String.SnakeCaseToCamel(item.Name.String()),
|
||||
"{FIELD}": wrapperType.String(item.Name.String()).SnakeCaseToCamel(),
|
||||
"{COLUMN}": item.Name.String(),
|
||||
"{JSON_TAG}": item.Name.String(),
|
||||
"{DEFAULT_VALUE}": "",
|
||||
|
Reference in New Issue
Block a user