From 7cff51c002854263a71b83ffba476895000b85fb Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Sat, 15 Sep 2018 14:17:28 -0500 Subject: [PATCH] Fix some code highlighting and add computed col ref --- api.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/api.rst b/api.rst index 9099dcc30..705cfc31e 100644 --- a/api.rst +++ b/api.rst @@ -221,7 +221,7 @@ As mentioned, computed columns do not appear in the output by default. However y .. important:: - Computed columns must be created under the exposed schema to be used in this way. + Computed columns must be created under the :ref:`exposed schema ` to be used in this way. Ordering -------- @@ -378,30 +378,30 @@ Binary output If you want to return raw binary data from a :code:`bytea` column, you must specify :code:`application/octet-stream` as part of the :code:`Accept` header and select a single column :code:`?select=bin_data`. -.. code:: http +.. code-block:: http GET /items?select=bin_data&id=eq.1 HTTP/1.1 Accept: application/octet-stream -You can also request binary output when calling stored procedures and since they can return a scalar value you are not forced to use :code:`select` +You can also request binary output when calling `Stored Procedures`_ and since they can return a scalar value you are not forced to use :code:`select` for this case. -.. code:: sql +.. code-block:: postgres CREATE FUNCTION closest_point(..) RETURNS bytea .. -.. code:: http +.. code-block:: http POST /rpc/closest_point HTTP/1.1 Accept: application/octet-stream If the stored procedure returns non-scalar values, you need to do a :code:`select` in the same way as for GET binary output. -.. code:: sql +.. code-block:: sql CREATE FUNCTION overlapping_regions(..) RETURNS SETOF TABLE(geom_twkb bytea, ..) .. -.. code:: http +.. code-block:: http POST /rpc/overlapping_regions?select=geom_twkb HTTP/1.1 Accept: application/octet-stream @@ -502,8 +502,8 @@ PostgREST can also detect relations going through join tables. Thus you can requ Whenever foreign key relations change in the database schema you must refresh PostgREST's schema cache to allow resource embedding to work properly. See the section :ref:`schema_reloading`. -Embedded Operations -------------------- +Embedded Filters +---------------- Embedded resources can be shaped similarly to their top-level counterparts. To do so, prefix the query parameters with the name of the embedded resource. For instance, to order the actors in each film: @@ -832,7 +832,7 @@ All tables and `auto-updatable views