From 8ae6b012f4abba8d7643b2b1c8e311885d01c31b Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 10 May 2023 21:23:34 -0300 Subject: [PATCH] add empty embed filter --- docs/references/api/resource_embedding.rst | 28 ++++++++++++++++++++-- docs/releases/v11.0.0.rst | 6 +++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/references/api/resource_embedding.rst b/docs/references/api/resource_embedding.rst index 231ddd377..e410ba447 100644 --- a/docs/references/api/resource_embedding.rst +++ b/docs/references/api/resource_embedding.rst @@ -418,8 +418,8 @@ The result will show the nested actors named Tom and order them by last name. Al .. _embedding_top_level_filter: -Embedding with Top-level Filtering ----------------------------------- +Top-level Filtering +------------------- By default, :ref:`embed_filters` don't change the top-level resource(``films``) rows at all: @@ -481,6 +481,30 @@ In order to filter the top level rows you need to add ``!inner`` to the embedded } ] +.. _empty_embed_filter: + +Empty Embed Filter +~~~~~~~~~~~~~~~~~~ + +If you want to filter the films by actors but don't want to include them in the response, empty the embedded columns. + +.. tabs:: + + .. code-tab:: http + + GET /films?select=title,actors!inner()&actors.first_name=eq.Jehanne HTTP/1.1 + + .. code-tab:: bash Curl + + curl "http://localhost:3000/films?select=title,actors!inner()&actors.first_name=eq.Jehanne" + +.. code-block:: json + [ + { + "title": "The Haunted Castle", + } + ] + .. _embedding_partitioned_tables: Embedding Partitioned Tables diff --git a/docs/releases/v11.0.0.rst b/docs/releases/v11.0.0.rst index c7cf789ea..a346e1797 100644 --- a/docs/releases/v11.0.0.rst +++ b/docs/releases/v11.0.0.rst @@ -10,6 +10,11 @@ Horizontal Filtering - New ``isdistinct`` :ref:`operator `. It is a direct translation of `IS DINTINCT FROM `_. - New ``and/all`` :ref:`modifiers`. +Resource Embedding +~~~~~~~~~~~~~~~~~~ + +- New :ref:`empty_embed_filter`. + OpenAPI ~~~~~~~ @@ -38,6 +43,7 @@ Breaking changes - Removed Bulk Call with ``Prefer: params=multiple-objects`` on Stored Procedures. - To comply with `RFC 9110 `_, the Range header is now only considered on GET. + + Other methods will ignore it and instead should use the ``limit/offset``. + PUT requests no longer return an error when this header is present (using limit/offset still triggers the error)