Skip to content

Commit

Permalink
Merge pull request #8 from IOTechSystems/EB-4021-branch-2
Browse files Browse the repository at this point in the history
Eb 4021 branch 2
  • Loading branch information
TomFlem committed Apr 5, 2024
2 parents 028caa1 + e99b6c7 commit 1877417
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/main/18_delete.go.tpl
Expand Up @@ -281,7 +281,7 @@ func (o {{$alias.UpSingular}}Slice) DeleteAll({{if .NoContext}}exec boil.Executo
args = append(args, pkeyArgs...)
}
sql = "DELETE FROM {{$schemaTable}} WHERE " +
strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), {{if .Dialect.UseIndexPlaceholders}}1{{else}}0{{end}}, {{$alias.DownSingular}}PrimaryKeyColumns, len(o))
strmangle.WhereInClause(string(dialect.LQ), string(dialect.RQ), {{if .Dialect.UseIndexPlaceholders}}1{{else}}0{{end}}, {{$alias.DownSingular}}PrimaryKeyColumns, len(o))
} else {
currTime := time.Now().In(boil.GetLocation())
for _, obj := range o {
Expand All @@ -291,7 +291,7 @@ func (o {{$alias.UpSingular}}Slice) DeleteAll({{if .NoContext}}exec boil.Executo
}
wl := []string{"{{$softDelCol}}"}
sql = fmt.Sprintf("UPDATE {{$schemaTable}} SET %s WHERE " +
strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), {{if .Dialect.UseIndexPlaceholders}}2{{else}}0{{end}}, {{$alias.DownSingular}}PrimaryKeyColumns, len(o)),
strmangle.WhereInClause(string(dialect.LQ), string(dialect.RQ), {{if .Dialect.UseIndexPlaceholders}}2{{else}}0{{end}}, {{$alias.DownSingular}}PrimaryKeyColumns, len(o)),
strmangle.SetParamNames("{{.LQ}}", "{{.RQ}}", {{if .Dialect.UseIndexPlaceholders}}1{{else}}0{{end}}, wl),
)
args = append([]interface{}{currTime}, args...)
Expand All @@ -304,7 +304,7 @@ func (o {{$alias.UpSingular}}Slice) DeleteAll({{if .NoContext}}exec boil.Executo
}

sql := "DELETE FROM {{$schemaTable}} WHERE " +
strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), {{if .Dialect.UseIndexPlaceholders}}1{{else}}0{{end}}, {{$alias.DownSingular}}PrimaryKeyColumns, len(o))
strmangle.WhereInClause(string(dialect.LQ), string(dialect.RQ), {{if .Dialect.UseIndexPlaceholders}}1{{else}}0{{end}}, {{$alias.DownSingular}}PrimaryKeyColumns, len(o))
{{- end}}

{{if .NoContext -}}
Expand Down

0 comments on commit 1877417

Please sign in to comment.