2020-08-19 10:41:19 +08:00
|
|
|
package template
|
2020-07-29 17:11:41 +08:00
|
|
|
|
2022-04-01 22:19:52 +08:00
|
|
|
// New defines the template for creating model instance.
|
|
|
|
const New = `
|
|
|
|
func new{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf{{end}}) *default{{.upperStartCamelObject}}Model {
|
2020-11-24 22:36:23 +08:00
|
|
|
return &default{{.upperStartCamelObject}}Model{
|
2020-08-19 10:41:19 +08:00
|
|
|
{{if .withCache}}CachedConn: sqlc.NewConn(conn, c){{else}}conn:conn{{end}},
|
2021-07-23 11:45:15 +08:00
|
|
|
table: {{.table}},
|
2020-07-29 17:11:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|