template

package
v1.1.5-0...-12a9ee2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Imports = `` /* 324-byte string literal not displayed */

	ImportsNoCache = `` /* 275-byte string literal not displayed */

)
View Source
var Delete = `` /* 709-byte string literal not displayed */
View Source
var DeleteMethod = `Delete({{.lowerStartCamelPrimaryKey}} {{.dataType}}) error`
View Source
var Error = `package {{.pkg}}

import "github.com/tal-tech/go-zero/core/stores/sqlx"

var ErrNotFound = sqlx.ErrNotFound
`
View Source
var Field = `{{.name}} {{.type}} {{.tag}} {{if .hasComment}}// {{.comment}}{{end}}`
View Source
var FindOne = `` /* 1005-byte string literal not displayed */

通过id查询

View Source
var FindOneByField = `` /* 1118-byte string literal not displayed */

通过指定字段查询

View Source
var FindOneByFieldExtraMethod = `` /* 440-byte string literal not displayed */
View Source
var FindOneByFieldMethod = `FindOneBy{{.upperField}}({{.in}}) (*{{.upperStartCamelObject}}, error) `
View Source
var FindOneMethod = `FindOne({{.lowerStartCamelPrimaryKey}} {{.dataType}}) (*{{.upperStartCamelObject}}, error)`
View Source
var Insert = `` /* 845-byte string literal not displayed */
View Source
var InsertMethod = `Insert(data {{.upperStartCamelObject}}) (sql.Result,error)`
View Source
var Model = `package {{.pkg}}
{{.imports}}
{{.vars}}
{{.types}}
{{.new}}
{{.insert}}
{{.find}}
{{.update}}
{{.delete}}
{{.extraMethod}}
`
View Source
var New = `` /* 297-byte string literal not displayed */
View Source
var Tag = "`db:\"{{.field}}\"`"
View Source
var Types = `` /* 261-byte string literal not displayed */
View Source
var Update = `` /* 638-byte string literal not displayed */
View Source
var UpdateMethod = `Update(data {{.upperStartCamelObject}}) 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}}
)
`, "`", "`", "`", "`", "`", "`", "`", "`")

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL