diff --git a/admin.rst b/admin.rst index 6835aa9c1..0151c09af 100644 --- a/admin.rst +++ b/admin.rst @@ -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. +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 .. Alternate URL structure .. API Versioning diff --git a/api.rst b/api.rst index 0e9aa142e..e45952bf8 100644 --- a/api.rst +++ b/api.rst @@ -11,7 +11,7 @@ There are no deeply/nested/routes. Each route provides OPTIONS, GET, POST, PATCH .. 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 ---------