You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT*FROM bar
ORDER BY
CASE WHEN (:$1.SortField(): ='updatedAt'AND :$1.Order(): ='ASC') THEN updated_at END ASC
,CASE WHEN (:$1.SortField(): ='updatedAt'AND :$1.Order(): ='DESC') THEN updated_at END DESC
,CASE WHEN (:$1.SortField(): ='age'AND :$1.Order(): ='ASC') THEN age END ASC
,CASE WHEN (:$1.SortField(): ='age'AND :$1.Order(): ='DESC') THEN age END DESC
,CASE WHEN (:$1.SortField(): ='active'AND :$1.Order(): ='ASC') THEN active END ASC
,CASE WHEN (:$1.SortField(): ='active'AND :$1.Order(): ='DESC') THEN active END DESC
,CASE WHEN (:$1.SortField(): ='name'AND :$1.Order(): ='ASC') THEN (firstname ||''|| lastname) END ASC
,CASE WHEN (:$1.SortField(): ='name'AND :$1.Order(): ='DESC') THEN (firstname ||''|| lastname) END DESC
OFFSET :$1.Offset(): FETCH NEXT :$1.Count(): ROWS ONLY;
So the idea is to be able to pass interface types and call their functions. This is one specific example but there could be many. In my case, the pagination parameters come from different sources that may calculate the offset/size differently.
What's your take?
The text was updated successfully, but these errors were encountered:
Consider this scenario
I was thinking having something like this would reduce the boilerplate code for may similarly designed DAOs
Then the
paged_bars
query would be like thisSo the idea is to be able to pass
interface
types and call their functions. This is one specific example but there could be many. In my case, the pagination parameters come from different sources that may calculate the offset/size differently.What's your take?
The text was updated successfully, but these errors were encountered: