mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 18:00:24 +08:00
089cdaa75f
* Support postgresql generate * Update template Var * Support to generate postgresql model * Support to generate postgresql model * Update template Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
12 lines
381 B
Go
12 lines
381 B
Go
package template
|
|
|
|
// New defines an template for creating model instance
|
|
var New = `
|
|
func New{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf{{end}}) {{.upperStartCamelObject}}Model {
|
|
return &default{{.upperStartCamelObject}}Model{
|
|
{{if .withCache}}CachedConn: sqlc.NewConn(conn, c){{else}}conn:conn{{end}},
|
|
table: {{.table}},
|
|
}
|
|
}
|
|
`
|