From a163828c6ca2eaa53b09ad5e3b691daf7577d2af Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 1 Jan 2019 17:20:01 -0500 Subject: [PATCH] Fix #192, Add section for quoting filters. Also reorder the Unicode Support section. --- api.rst | 52 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/api.rst b/api.rst index 6d27c0b86..566552f15 100644 --- a/api.rst +++ b/api.rst @@ -232,6 +232,41 @@ As mentioned, computed columns do not appear in the output by default. However y Computed columns must be created under the :ref:`exposed schema ` to be used in this way. +Unicode support +--------------- + +PostgREST supports unicode in schemas, tables, columns and values. To access a table with unicode name, use percent encoding. + +To request this: + +.. code-block:: http + + GET /موارد HTTP/1.1 + +Do this: + +.. code-block:: http + + GET /%D9%85%D9%88%D8%A7%D8%B1%D8%AF HTTP/1.1 + +Reserved characters +~~~~~~~~~~~~~~~~~~~ + +If filters include PostgREST reserved characters(``,``, ``.``, ``:``, ``()``) you'll have to surround them in percent encoded double quotes ``%22`` for correct processing. + +Here ``Hebdon,John`` and ``Williams,Mary`` are values. + +.. code-block:: http + + GET /employees?name=in.(%22Hebdon,John%22,%22Williams,Mary%22) HTTP/1.1 + +Here ``information.cpe`` is a column name. + +.. code-block:: http + + GET /vulnerabilities?%22information.cpe%22=like.*MS* HTTP/1.1 + + Ordering -------- @@ -419,23 +454,6 @@ If the stored procedure returns non-scalar values, you need to do a :code:`selec If more than one row would be returned the binary results will be concatenated with no delimiter. -Unicode Support -=============== - -PostgREST supports unicode in schemas, tables, columns and values. To access a table with unicode name, use percent encoding. - -To request this: - -.. code-block:: html - - http://localhost:3000/موارد - -Do this: - -.. code-block:: html - - http://localhost:3000/%D9%85%D9%88%D8%A7%D8%B1%D8%AF - .. _resource_embedding: Resource Embedding