Skip to content

Conversation

@taimoorzaeem
Copy link
Collaborator

Adds a note about resource embedding and vertical filtering sections that they are top-level operations. This resolves #4352.

@taimoorzaeem taimoorzaeem added the docs Only related to documentation label Nov 3, 2025
@taimoorzaeem taimoorzaeem marked this pull request as draft November 4, 2025 05:33
@taimoorzaeem taimoorzaeem marked this pull request as ready for review November 4, 2025 07:32
Adds a note about resource embedding and vertical filtering
sections when they are combined with mutation queries.

This resolves PostgREST#4352.

Signed-off-by: Taimoor Zaeem <[email protected]>
Copy link
Member

@steve-chavez steve-chavez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like this resolves #4352. The problem there is horizontal filtering and not vertical?

#4352 (comment) says that the confusion comes from this section:

Deletions also support Return Representation, Resource Embedding and Vertical Filtering.

On https://postgrest--4446.org.readthedocs.build/en/4446/references/api/tables_views.html


So to summarize, I believe we should:

  • Updates also support:
    - :ref:`prefer_return`
    - :ref:`resource_embedding`
    • Correct to - :ref:resource_embedding, with the exception of top-level filtering (<link>)
  • Deletions also support :ref:`prefer_return`, :ref:`resource_embedding` and :ref:`v_filter`.
    • Change here to a bullet list, same as above "Updates"
    • Correct to - :ref:resource_embedding, with the exception of top-level filtering (<link>)


.. note::

It is **not** possible to perform mutations *on* related resources. When combining mutations and resource embedding, the mutation is performed first and then the related resource is returned in combination with :ref:`prefer_return`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reading the discussion about the breaking change again, I think we should not document this behavior. This is a bug that needs to be fixed by throwing an error accordingly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we consider it a bug if we are actively testing for it (and for a while now)?

it "can embed (parent) entities" $
request methodDelete "/tasks?id=eq.8&select=id,name,project:projects(id)" [("Prefer", "return=representation")] ""
`shouldRespondWith` [json|[{"id":8,"name":"Code OSX","project":{"id":4}}]|]
{ matchStatus = 200
, matchHeaders = ["Content-Range" <:> "*/*"]
}

Not against removing this behavior, but I think it could still be considered a breaking change due to these tests.

@taimoorzaeem taimoorzaeem marked this pull request as draft November 8, 2025 08:46
@taimoorzaeem taimoorzaeem removed the docs Only related to documentation label Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

DELETE ignores top-level filtering of resource embeddings

4 participants