go-zero/tools/goctl/model/sql/template/vars.go

15 lines
622 B
Go
Raw Normal View History

2020-07-29 17:11:41 +08:00
package sqltemplate
var Vars = `
var (
{{.lowerObject}}FieldNames = builderx.FieldNames(&{{.upperObject}}{})
{{.lowerObject}}Rows = strings.Join({{.lowerObject}}FieldNames, ",")
{{.lowerObject}}RowsExpectAutoSet = strings.Join(stringx.Remove({{.lowerObject}}FieldNames, "{{.snakePrimaryKey}}", "create_time", "update_time"), ",")
{{.lowerObject}}RowsWithPlaceHolder = strings.Join(stringx.Remove({{.lowerObject}}FieldNames, "{{.snakePrimaryKey}}", "create_time", "update_time"), "=?,") + "=?"
{{.keysDefine}}
{{if .createNotFound}}ErrNotFound = sqlx.ErrNotFound{{end}}
)
`