Fix #205, operators table with heading
This commit is contained in:
committed by
Steve Chávez
parent
f759b8bfc6
commit
0b5e168c8d
@@ -45,43 +45,42 @@ Complex logic can also be applied:
|
|||||||
|
|
||||||
GET /people?and=(grade.gte.90,student.is.true,or(age.gte.14,age.is.null)) HTTP/1.1
|
GET /people?and=(grade.gte.90,student.is.true,or(age.gte.14,age.is.null)) HTTP/1.1
|
||||||
|
|
||||||
|
Operators
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
These operators are available:
|
These operators are available:
|
||||||
|
|
||||||
============ =============================================== =====================
|
============ ======================== ==================================================================================
|
||||||
Abbreviation Meaning PostgreSQL Equivalent
|
Abbreviation In PostgreSQL Meaning
|
||||||
============ =============================================== =====================
|
============ ======================== ==================================================================================
|
||||||
eq equals :code:`=`
|
eq :code:`=` equals
|
||||||
gt greater than :code:`>`
|
gt :code:`>` greater than
|
||||||
gte greater than or equal :code:`>=`
|
gte :code:`>=` greater than or equal
|
||||||
lt less than :code:`<`
|
lt :code:`<` less than
|
||||||
lte less than or equal :code:`<=`
|
lte :code:`<=` less than or equal
|
||||||
neq not equal :code:`<>` or :code:`!=`
|
neq :code:`<>` or :code:`!=` not equal
|
||||||
like LIKE operator (use * in place of %) :code:`LIKE`
|
like :code:`LIKE` LIKE operator (use * in place of %)
|
||||||
ilike ILIKE operator (use * in place of %) :code:`ILIKE`
|
ilike :code:`ILIKE` ILIKE operator (use * in place of %)
|
||||||
in one of a list of values e.g. :code:`IN`
|
in :code:`IN` one of a list of values, e.g. :code:`?a=in.(1,2,3)`
|
||||||
:code:`?a=in.(1,2,3)` – also supports commas
|
– also supports commas in quoted strings like
|
||||||
in quoted strings like
|
:code:`?a=in.("hi,there","yes,you")`
|
||||||
:code:`?a=in.("hi,there","yes,you")`
|
is :code:`IS` checking for exact equality (null,true,false)
|
||||||
is checking for exact equality (null,true,false) :code:`IS`
|
fts :code:`@@` :ref:`fts` using to_tsquery
|
||||||
fts :ref:`fts` using to_tsquery :code:`@@`
|
plfts :code:`@@` :ref:`fts` using plainto_tsquery
|
||||||
plfts :ref:`fts` using plainto_tsquery :code:`@@`
|
phfts :code:`@@` :ref:`fts` using phraseto_tsquery
|
||||||
phfts :ref:`fts` using phraseto_tsquery :code:`@@`
|
wfts :code:`@@` :ref:`fts` using websearch_to_tsquery
|
||||||
wfts :ref:`fts` using websearch_to_tsquery :code:`@@`
|
cs :code:`@>` contains e.g. :code:`?tags=cs.{example, new}`
|
||||||
cs contains e.g. :code:`?tags=cs.{example, new}` :code:`@>`
|
cd :code:`<@` contained in e.g. :code:`?values=cd.{1,2,3}`
|
||||||
cd contained in e.g. :code:`?values=cd.{1,2,3}` :code:`<@`
|
ov :code:`&&` overlap (have points in common), e.g. :code:`?period=ov.[2017-01-01,2017-06-30]` –
|
||||||
ov overlap (have points in common), :code:`&&`
|
also supports array types, use curly braces instead of square brackets e.g.
|
||||||
e.g. :code:`?period=ov.[2017-01-01,2017-06-30]`
|
:code: `?arr=ov.{1,3}`
|
||||||
– also supports array types, use curly braces
|
sl :code:`<<` strictly left of, e.g. :code:`?range=sl.(1,10)`
|
||||||
instead of square brackets
|
sr :code:`>>` strictly right of
|
||||||
e.g. :code: `?arr=ov.{1,3}`
|
nxr :code:`&<` does not extend to the right of, e.g. :code:`?range=nxr.(1,10)`
|
||||||
sl strictly left of, e.g. :code:`?range=sl.(1,10)` :code:`<<`
|
nxl :code:`&>` does not extend to the left of
|
||||||
sr strictly right of :code:`>>`
|
adj :code:`-|-` is adjacent to, e.g. :code:`?range=adj.(1,10)`
|
||||||
nxr does not extend to the right of, :code:`&<`
|
not :code:`NOT` negates another operator, see below
|
||||||
e.g. :code:`?range=nxr.(1,10)`
|
============ ======================== ==================================================================================
|
||||||
nxl does not extend to the left of :code:`&>`
|
|
||||||
adj is adjacent to, e.g. :code:`?range=adj.(1,10)` :code:`-|-`
|
|
||||||
not negates another operator, see below :code:`NOT`
|
|
||||||
============ =============================================== =====================
|
|
||||||
|
|
||||||
To negate any operator, prefix it with :code:`not` like :code:`?a=not.eq.2` or :code:`?not.and=(a.gte.0,a.lte.100)` .
|
To negate any operator, prefix it with :code:`not` like :code:`?a=not.eq.2` or :code:`?not.and=(a.gte.0,a.lte.100)` .
|
||||||
|
|
||||||
@@ -982,7 +981,7 @@ UPSERT operates based on the primary key columns, you must specify all of them.
|
|||||||
|
|
||||||
.. important::
|
.. important::
|
||||||
After creating a table or changing its primary key, you must refresh PostgREST schema cache for UPSERT to work properly. To learn how to refresh the cache see :ref:`schema_reloading`.
|
After creating a table or changing its primary key, you must refresh PostgREST schema cache for UPSERT to work properly. To learn how to refresh the cache see :ref:`schema_reloading`.
|
||||||
|
|
||||||
|
|
||||||
A single row UPSERT can be done by using :code:`PUT` and filtering the primary key columns with :code:`eq`:
|
A single row UPSERT can be done by using :code:`PUT` and filtering the primary key columns with :code:`eq`:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user