forked from ebhomengo/niki
1
0
Fork 0
niki/pkg/query_builder/mysql/sort.go

16 lines
270 B
Go

package mysqlquerybuilder
import (
"fmt"
"git.gocasts.ir/ebhomengo/niki/param"
)
func BuildSortQuery(sort param.SortRequest) string {
if sort.Field == "" && sort.Direction == "" {
return ""
}
return fmt.Sprintf("ORDER BY %s %s", sort.Field, sort.Direction)
}