You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
330 B
Smarty

3 years ago
3 years ago
func (m *default{{.upperStartCamelObject}}Model) Insert(ctx context.Context, data *{{.upperStartCamelObject}}) error {
3 years ago
{{if .withCache}}{{.keys}}
3 years ago
err := m.ExecCtx(ctx, func(conn *gorm.DB) *gorm.DB {
return conn.Create(&data)
}, {{.keyValues}}){{else}}err:=m.conn.WithContext(ctx).Create(&data).Error{{end}}
3 years ago
return err
3 years ago
}