Skip to content

Commit

Permalink
add limit
Browse files Browse the repository at this point in the history
  • Loading branch information
moremorefun committed Nov 3, 2020
1 parent 6166927 commit 7649b41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion template/sql.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ func SQLGet{{$tableInfo.TableNameCamel}}Col(ctx context.Context, tx mcommon.DbEx
FROM
{{$tableInfo.TableName}}
WHERE
id=:id`)
id=:id
LIMIT 1`)

var row DB{{$tableInfo.TableNameCamel}}
ok, err := mcommon.DbGetNamedContent(
Expand Down Expand Up @@ -318,6 +319,7 @@ FROM
query.WriteString("\n")
argMap[key] = value
}
query.WriteString("LIMIT 1")

var row DB{{$tableInfo.TableNameCamel}}
ok, err := mcommon.DbGetNamedContent(
Expand Down

0 comments on commit 7649b41

Please sign in to comment.