WIP: OrderBy implementation
Go Tests / test (pull_request) Successful in 1m4s

This commit is contained in:
2026-06-05 17:19:11 +02:00
parent 146f07fa02
commit cd1f61fb87
3 changed files with 98 additions and 23 deletions
+5 -4
View File
@@ -98,10 +98,11 @@ func (s *Select[T]) execute(conn *simpleorm.DBConnection, tx *sql.Tx) error {
}
if len(s.ordering) > 0 {
dml += " ORDER BY"
for _, orderBy := range s.ordering {
dml += " " + orderBy.Field + " " + orderBy.Direction
orderBy, err := s.target.GetOrderByDML(s.ordering...)
if err != nil {
log.LogError("Failed to create ORDER BY part: %s", err)
} else {
dml += orderBy
}
}