add quick example

This commit is contained in:
kevin
2020-08-27 22:54:18 +08:00
parent 38806e7237
commit 77e23ad65d
9 changed files with 194 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ func (m *{{.upperStartCamelObject}}Model) Delete({{.lowerStartCamelPrimaryKey}}
if err!=nil{
return err
}{{end}}
{{.keys}}
_, err {{if .containsIndexCache}}={{else}}:={{end}} m.Exec(func(conn sqlx.SqlConn) (result sql.Result, err error) {
query := ` + "`" + `delete from ` + "` +" + ` m.table + ` + " `" + ` where {{.originalPrimaryKey}} = ?` + "`" + `

View File

@@ -4,8 +4,5 @@ var Error = `package model
import "github.com/tal-tech/go-zero/core/stores/sqlx"
var (
ErrNotFound = sqlx.ErrNotFound
)
var ErrNotFound = sqlx.ErrNotFound
`