generate

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const EntityTpl = `package {{.Package}}

type {{ .ModelName }} struct {
    {{ range .Fields}}
    {{- if ne .Comment ""}} 
    // {{ .Comment}} 
    {{- end}}
    {{ .Name}} {{.Type}} ` + "`gorm:\"{{.Meta}}\"`\n" +
	`{{ end }}
}

func ({{ .ModelName}}) TableName() string {
    return "{{ .TableName}}"
}

const (
{{ range .Fields}}
    {{ $.ModelName }}{{ .Name}} = "{{.Column}}"
{{end}}
)
`

Variables

This section is empty.

Functions

func Mysql

func Mysql(db *gorm.DB, config MysqlGenerateConfig) error

Types

type MysqlGenerateConfig

type MysqlGenerateConfig struct {
	OutDir string   //输出目录
	Tables []string //逆向的表

}

Jump to

Keyboard shortcuts

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