Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Imports = `` /* 364-byte string literal not displayed */ ImportsNoCache = `` /* 275-byte string literal not displayed */ )
View Source
var Delete = `` /* 251-byte string literal not displayed */
View Source
var DeleteMethod = `Delete( condition map[string]interface{} ) error`
View Source
var Error = `package {{.pkg}}
import "github.com/sjclijie/go-zero/core/stores/sqlx"
var ErrNotFound = sqlx.ErrNotFound
`
View Source
var Field = `{{.name}} {{.type}} {{.tag}} {{if .hasComment}}// {{.comment}}{{end}}`
View Source
var FindList = `` /* 307-byte string literal not displayed */
通过id查询
View Source
var FindListMethod = `QueryList( condition map[string]interface{} ) ( []*{{.upperStartCamelObject}}, error)`
View Source
var FindOne = `` /* 299-byte string literal not displayed */
通过id查询
View Source
var FindOneByField = `` /* 1118-byte string literal not displayed */
通过指定字段查询
View Source
var FindOneByFieldExtraMethod = `` /* 155-byte string literal not displayed */
View Source
var FindOneByFieldMethod = `FindOneBy{{.upperField}}({{.in}}) (*{{.upperStartCamelObject}}, error) `
View Source
var FindOneMethod = `Query( condition map[string]interface{} ) ( *{{.upperStartCamelObject}}, error)`
View Source
var Insert = `` /* 161-byte string literal not displayed */
View Source
var InsertMethod = `Insert(data *{{.upperStartCamelObject}}) (int64,error)`
View Source
var Model = `package {{.pkg}}
{{.imports}}
{{.vars}}
{{.types}}
{{.new}}
{{.insert}}
{{.find}}
{{.update}}
{{.delete}}
{{.extraMethod}}
`
View Source
var New = `` /* 738-byte string literal not displayed */
View Source
var Tag = "`gorm:\"column:{{.field}}{{if .nullAble}};default:{{.defaultValue}}{{end}}\"`"
View Source
var Types = `` /* 223-byte string literal not displayed */
View Source
var Update = `` /* 235-byte string literal not displayed */
View Source
var UpdateMethod = `Update(condition map[string]interface{}, data *{{.upperStartCamelObject}})(int64, error)`
View Source
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}}
{{.lowerStartCamelObject}}TableName = "{{.tableName}}"
)
`, "`", "`", "`", "`", "`", "`", "`", "`")
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.