2024-06-12 08:15:28 +00:00
|
|
|
package mysqlquerybuilder
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/param"
|
|
|
|
)
|
|
|
|
|
2024-07-24 23:45:04 +00:00
|
|
|
func BuildPaginationQuery(pagination param.PaginationRequest) (query string, args []any) {
|
2024-09-21 20:48:23 +00:00
|
|
|
if pagination.PageSize == 0 && pagination.PageNumber == 0 {
|
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
2024-06-12 08:15:28 +00:00
|
|
|
return "LIMIT ? OFFSET ?", []any{pagination.GetPageSize(), pagination.GetOffset()}
|
|
|
|
}
|