Skip to content

Commit

Permalink
♻️ Refactor(paginate.go): add count name
Browse files Browse the repository at this point in the history
  • Loading branch information
booscaaa committed Nov 13, 2023
1 parent 5dcac5f commit c646bc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion v2/paginate/paginate.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func GenerateCountQuery(params *paginQueryParams) (string, []interface{}) {
idColumnName := getFieldName("id", "json", "paginate", params.Struct)

if idColumnName != "" {
countSelectClause = fmt.Sprintf("SELECT %s", idColumnName)
countSelectClause = fmt.Sprintf("SELECT COUNT(%s)", idColumnName)
}

clauses = append(clauses, countSelectClause)
Expand Down

0 comments on commit c646bc7

Please sign in to comment.