forked from ebhomengo/niki
14 lines
337 B
Go
14 lines
337 B
Go
package mysqlquerybuilder
|
|
|
|
import (
|
|
"git.gocasts.ir/ebhomengo/niki/param"
|
|
)
|
|
|
|
func BuildPaginationQuery(pagination param.PaginationRequest) (query string, args []any) {
|
|
if pagination.PageSize == 0 && pagination.PageNumber == 0 {
|
|
return "", nil
|
|
}
|
|
|
|
return "LIMIT ? OFFSET ?", []any{pagination.GetPageSize(), pagination.GetOffset()}
|
|
}
|