Reference
Cheat sheet
Every word of the query language on one page, and a box to try them in.
Every example in the docs reads and writes this small to-do app: three people, four todos, their steps and their tags.
Type a request below and send it. The database lives in this page, so nothing you do here reaches a server.
a to-do database, running in this page
Type a request.
Reading
| select | List the columns you want, in the order you want them. | select=col,col |
| /{key} | Add the primary key to the path to read a single row as an object. | /todos/1 |
| relation(...) | Put a relation's name in select, with the columns you want from it in parentheses. | select=name,owner(name) |
| order | Sort by one or more columns, ascending or descending. | order=name |
| limit, offset | Take limit rows, after skipping offset of them. | limit=2 |
| relation.order, .limit, .offset | Prefix order, limit or offset with a relation's name to apply it inside the embed. | steps.order=priority.desc |
| count | Ask for count=exact to get the total number of matching rows in the Content-Range header. | count=exact |
| count(), sum(), avg(), min(), max() | Put aggregates in select; the plain columns beside them become the groups. | select=count() |
| "name" | Wrap a column name in double quotes so it can never be read as a keyword. | "limit"=gte.2 |
Filtering
| eq, neq | Keep the rows whose column equals, or differs from, a value. | status=eq.open |
| gt, gte, lt, lte | Compare numbers, text, dates and times. | estimate=gt.2 |
| in | Keep the rows whose column takes one of the listed values. | id=in.(1,3) |
| like, ilike | Keep the text that matches a pattern, where * stands for any text. | name=like.*rent |
| match, imatchPostgreSQL, MySQL only | Keep the text that matches a regular expression; imatch ignores case. | name=match.^f |
| is | Test for null, for a boolean value, or for a relation with no rows. | owner_id=is.null |
| ov, cs, cdPostgreSQL only | Compare an array column with a list: overlaps, contains, contained by. | labels=ov.{a,b} |
| not | Put not. before any operator to keep the rows it would have left out. | status=not.eq.done |
| relation.column | Name a related column with a dot to filter on what a row is linked to. | owner.name=eq.Ada |
| or, and | Group terms in or=(...) to keep rows matching any of them. | or=(status.eq.done,owner.name.eq.Linus) |
Writing
| Prefer: return=representation | Send this header with a write to receive the rows as they were stored. | Prefer: return=representation |