Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordering and Filtering #84

Open
RobertLemmens opened this issue Apr 18, 2018 · 3 comments
Open

Ordering and Filtering #84

RobertLemmens opened this issue Apr 18, 2018 · 3 comments

Comments

@RobertLemmens
Copy link

Hello,

Im adding this issue more as a question mark. I myself use some rest service based on this project and one thing i find difficult to think about in a clean, non redundant way is filtering and ordering. Are there any plans on adding these features someday? Id love to see how to go about that in a nice way. Right now i just have doobie queries matching the different kind of filterings / ordering i need with the matching endpoints. This somehow seems like a very bloated way to do it. I envision maybe something like an Ordering middleware thats able to map orderby=(field name) and orderType=(asc/desc). This seems hard to do however because of the different types and domains involved, but im not experienced enough to judge on that ;).

What are your thoughts?

@pauljamescleary
Copy link
Owner

Are you talking about some kind of Http4s level stuff to simplify endpoints that have those parameters?

Or are you referring to a general pattern throughout the system (endpoint, service, doobie) that reduces duplication?

@RobertLemmens
Copy link
Author

RobertLemmens commented Apr 19, 2018

I believe a general pattern throughout the system. Something that supports more advanced queries and possibly building the query. Consider something like the following:

orderstatus=shipped&shipdate={"gt":"2018-01-01"}&id={"lt":"250"}&orderby=shipdate

Its easy to create an endpoint expecting the specific (optional)values and create some business to check whats there and then point to some specific doobie implementation, but this seems verbose so im wondering about doing stuff like that in a more generic/dynamic way that follows a clean pattern.

*I see allot of discussion regarding the "right" way to do this in REST, so im not advocating for a specific method or uri schema, im just thinking about the concept.

I might be thinking out of scope though.

@pauljamescleary
Copy link
Owner

I think this is a valid interesting idea. Unclear of how to do it. Would gladly welcome and discuss ideas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants