Unexport partial...update() store functions, fix messaging
This commit is contained in:
@@ -33,7 +33,6 @@ type (
|
||||
{{- end }}
|
||||
{{ if .Update.Enable }}
|
||||
Update{{ export $Types.Singular }}(ctx context.Context{{ template "extraArgsDef" . }}, rr ... *{{ $Types.GoType }}) error
|
||||
Partial{{ export $Types.Singular }}Update(ctx context.Context{{ template "extraArgsDef" . }}, onlyColumns []string, rr ... *{{ $Types.GoType }}) error
|
||||
{{- end }}
|
||||
{{ if .Upsert.Enable }}
|
||||
Upsert{{ export $Types.Singular }}(ctx context.Context{{ template "extraArgsDef" . }}, rr ... *{{ $Types.GoType }}) error
|
||||
@@ -88,11 +87,6 @@ func Create{{ export $Types.Singular }}(ctx context.Context, s {{ export $Types.
|
||||
func Update{{ export $Types.Singular }}(ctx context.Context, s {{ export $Types.Plural }}{{ template "extraArgsDef" . }}, rr ... *{{ $Types.GoType }}) error {
|
||||
return s.Update{{ export $Types.Singular }}(ctx{{ template "extraArgsCall" . }}, rr... )
|
||||
}
|
||||
|
||||
// Partial{{ export $.Types.Singular }}Update updates one or more existing {{ $.Types.Plural }} in store
|
||||
func Partial{{ export $Types.Singular }}Update(ctx context.Context, s {{ export $Types.Plural }}{{ template "extraArgsDef" . }}, onlyColumns []string, rr ... *{{ $Types.GoType }}) error {
|
||||
return s.Partial{{ export $Types.Singular }}Update(ctx{{ template "extraArgsCall" . }}, onlyColumns, rr...)
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Upsert.Enable }}
|
||||
|
||||
@@ -341,11 +341,11 @@ func (s Store) {{ toggleExport .Create.Export "Create" $.Types.Singular }}(ctx c
|
||||
{{ if .Update.Enable }}
|
||||
// {{ toggleExport .Update.Export "Update" $.Types.Singular }} updates one or more existing rows in {{ $.RDBMS.Table }}
|
||||
func (s Store) {{ toggleExport .Update.Export "Update" $.Types.Singular }}(ctx context.Context{{ template "extraArgsDef" . }}, rr ... *{{ $.Types.GoType }}) error {
|
||||
return s.config.ErrorHandler(s.{{ toggleExport .Update.Export "Partial" $.Types.Singular "Update" }}(ctx{{ template "extraArgsCall" . }}, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partial{{ export $.Types.Singular "Update" }}(ctx{{ template "extraArgsCall" . }}, nil, rr...))
|
||||
}
|
||||
|
||||
// {{ toggleExport .Update.Export "Partial" $.Types.Singular "Update" }} updates one or more existing rows in {{ $.RDBMS.Table }}
|
||||
func (s Store) {{ toggleExport .Update.Export "Partial" $.Types.Singular "Update" }}(ctx context.Context{{ template "extraArgsDef" . }}, onlyColumns []string, rr ... *{{ $.Types.GoType }}) (err error) {
|
||||
// partial{{ export $.Types.Singular "Update" }} updates one or more existing rows in {{ $.RDBMS.Table }}
|
||||
func (s Store) partial{{ export $.Types.Singular "Update" }}(ctx context.Context{{ template "extraArgsDef" . }}, onlyColumns []string, rr ... *{{ $.Types.GoType }}) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.check{{ export $.Types.Singular }}Constraints(ctx {{ template "extraArgsCall" $ }}, res)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user