From b2acda8ade28b1ee1c51aaa083bd8a594b586f40 Mon Sep 17 00:00:00 2001 From: Sergey Kurt Date: Sat, 1 Apr 2017 21:11:01 +0300 Subject: [PATCH] Generic Select statement in Reload --- templates/19_reload.tpl | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/templates/19_reload.tpl b/templates/19_reload.tpl index ff656f1..b1201b8 100644 --- a/templates/19_reload.tpl +++ b/templates/19_reload.tpl @@ -79,22 +79,8 @@ func (o *{{$tableNameSingular}}Slice) ReloadAll(exec boil.Executor) error { args = append(args, pkeyArgs...) } - {{if ne .DriverName "mssql" -}} - sql := fmt.Sprintf( - "SELECT {{$schemaTable}}.* FROM {{$schemaTable}} WHERE (%s) IN (%s)", - strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, {{$varNameSingular}}PrimaryKeyColumns), ","), - strmangle.Placeholders(dialect.IndexPlaceholders, len(*o) * len({{$varNameSingular}}PrimaryKeyColumns), 1, len({{$varNameSingular}}PrimaryKeyColumns)), - ) - {{- else -}} - startIndex := 1 - - if !dialect.IndexPlaceholders { - startIndex = 0 - } - sql := "SELECT {{$schemaTable}}.* FROM {{$schemaTable}} WHERE " + - strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), startIndex, {{$varNameSingular}}PrimaryKeyColumns, len(*o)) - {{- end}} + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), {{if .Dialect.IndexPlaceholders}}1{{else}}0{{end}}, {{$varNameSingular}}PrimaryKeyColumns, len(*o)) q := queries.Raw(exec, sql, args...)