Alternate url structure

This commit is contained in:
Joe Nelson
2016-11-19 12:04:10 -08:00
parent 954252ed16
commit d1d6001a6d
2 changed files with 17 additions and 1 deletions
+16
View File
@@ -183,6 +183,22 @@ To refresh the cache without restarting the PostgREST server, send its process a
For the future we're investigating ways to keep the cache updated without an intrusive setup procedure or system resource usage. For the future we're investigating ways to keep the cache updated without an intrusive setup procedure or system resource usage.
Alternate URL Structure
=======================
As discussed in `Singular or Plural`_, there are no special URL forms for singular resources in PostgREST, only operators for filtering. Thus there are no URLs like `/people/1`. It would be specified instead as
.. code:: http
GET /people?id=eq.1
Prefer: plurality=singular
This allows compound primary keys and makes the intent for singular response independent of a URL convention. However for any table which uses a simple primary key you can use Nginx to simulate the familiar URL convention.
.. code:: nginx
nginx code here
.. Administration .. Administration
.. Alternate URL structure .. Alternate URL structure
.. API Versioning .. API Versioning
+1 -1
View File
@@ -11,7 +11,7 @@ There are no deeply/nested/routes. Each route provides OPTIONS, GET, POST, PATCH
.. note:: .. note::
Why not provide nested routes? Many APIs allow nesting to retrieve related information, such as :code:`/films/1/director`. We offer a more flexible mechanism (inspired by GraphQL) to embed related information. It can handle one-to-many and many-to-many relationships. This is covered in the section about Embedding. Why not provide nested routes? Many APIs allow nesting to retrieve related information, such as :code:`/films/1/director`. We offer a more flexible mechanism (inspired by GraphQL) to embed related information. It can handle one-to-many and many-to-many relationships. This is covered in the section about `Resource Embedding`_.
Filtering Filtering
--------- ---------