mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-26 11:28:46 +08:00
6c624a6ed0
* fix sql builderx adding raw string quotation marks incompatibility bug * add unit test * remove comments * fix sql builderx adding raw string quotation marks incompatibility bug
15 lines
766 B
Go
15 lines
766 B
Go
package template
|
|
|
|
import "fmt"
|
|
|
|
var Vars = fmt.Sprintf(`
|
|
var (
|
|
{{.lowerStartCamelObject}}FieldNames = builderx.RawFieldNames(&{{.upperStartCamelObject}}{})
|
|
{{.lowerStartCamelObject}}Rows = strings.Join({{.lowerStartCamelObject}}FieldNames, ",")
|
|
{{.lowerStartCamelObject}}RowsExpectAutoSet = strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, {{if .autoIncrement}}"{{.originalPrimaryKey}}",{{end}} "%screate_time%s", "%supdate_time%s"), ",")
|
|
{{.lowerStartCamelObject}}RowsWithPlaceHolder = strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, "{{.originalPrimaryKey}}", "%screate_time%s", "%supdate_time%s"), "=?,") + "=?"
|
|
|
|
{{if .withCache}}{{.cacheKeys}}{{end}}
|
|
)
|
|
`, "`", "`", "`", "`", "`", "`", "`", "`")
|