go-zero/tools/goctl/model/sql/template/insert.go
2020-07-29 17:12:04 +08:00

10 lines
325 B
Go

package sqltemplate
var Insert = `
func (m *{{.upperObject}}Model) Insert(data {{.upperObject}}) error {
query := ` + "`" + `insert into ` + "`" + ` + m.table + ` + "`(` + " + `{{.lowerObject}}RowsExpectAutoSet` + " + `) value ({{.expression}})` " + `
_, err := m.ExecNoCache(query, {{.expressionValues}})
return err
}
`