Skip to content

Instantly share code, notes, and snippets.

@ErisDS
Created March 28, 2016 11:15
Show Gist options
  • Save ErisDS/f3e817e97f50ec039128 to your computer and use it in GitHub Desktop.
Save ErisDS/f3e817e97f50ec039128 to your computer and use it in GitHub Desktop.
API Browse Requests

Browse requests can be composed out of a set of parameters:

  • fields
  • filter
  • order
  • limit & page
  • include

These translate down to a set of query modifiers

  • columns
  • where
  • join
  • order
  • group & having
  • limit & offset

The translations are as follows:

  • fields translates 1:1 to columns
  • filter translates mostly to where clauses, but complex filters can also add join, group, having and order modifiers
  • order translates mostly to an order, but it may require complex subqueries or joins?
  • limit & page translate to limit & offset
  • include affects queries made in addition to the main query, except for count includes, which work slightly differently

Note: Permissions need to be applied to a browse request whenever a join or an include is made.

@laran
Copy link

laran commented Mar 29, 2016

Makes perfect sense.

I can't think of a case where order would require complex subqueries or joins. Can you think of a use case?

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