[GH-ISSUE #23] More REST query patterns #12

Closed
opened 2026-02-26 01:32:53 +03:00 by kerem · 3 comments
Owner

Originally created by @filmackay on GitHub (Jan 19, 2016).
Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/23

Just wondering what people's thoughts are on implementing more complex patterns for reading (joins and filters), along the lines of things like:

  • joins: /table1/id1/table2 - returns all the table2's related to table1 key id1
  • filters: /table1?id=id1 - alternative to /table1/id1
  • sort: /table1?_orderby=field1,field2
  • pagination: /table1?_size=100&page=1

(http://sailsjs.org/documentation/reference/blueprint-api for some ideas)

At some point it is easier to parse the URL, rather than prepare every conceivable pattern. Thoughts?

Originally created by @filmackay on GitHub (Jan 19, 2016). Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/23 Just wondering what people's thoughts are on implementing more complex patterns for reading (joins and filters), along the lines of things like: - joins: /table1/id1/table2 - returns all the table2's related to table1 key id1 - filters: /table1?id=id1 - alternative to /table1/id1 - sort: /table1?_orderby=field1,field2 - pagination: /table1?_size=100&page=1 (http://sailsjs.org/documentation/reference/blueprint-api for some ideas) At some point it is easier to parse the URL, rather than prepare every conceivable pattern. Thoughts?
kerem closed this issue 2026-02-26 01:32:53 +03:00
Author
Owner

@filmackay commented on GitHub (Jan 22, 2016):

Realised just now that filter, sort, pagination is already supported - just not documented, is that right - or are they placeholder / partial implementations?

<!-- gh-comment-id:173976581 --> @filmackay commented on GitHub (Jan 22, 2016): Realised just now that filter, sort, pagination is already supported - just not documented, is that right - or are they placeholder / partial implementations?
Author
Owner

@jeffknupp commented on GitHub (Jan 22, 2016):

Nope, they're fully supported. I'll be sure to update the docs as soon as I can.

<!-- gh-comment-id:173981808 --> @jeffknupp commented on GitHub (Jan 22, 2016): Nope, they're fully supported. I'll be sure to update the docs as soon as I can.
Author
Owner

@filmackay commented on GitHub (Jan 22, 2016):

What about join pattern: /table1/id1/table2/id2/table3

In this situation you really need to parse the URL, rather than pattern match on it with routes?

<!-- gh-comment-id:174014710 --> @filmackay commented on GitHub (Jan 22, 2016): What about join pattern: /table1/id1/table2/id2/table3 In this situation you really need to parse the URL, rather than pattern match on it with routes?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sandman2-jeffknupp#12
No description provided.