-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate target disambiguation #2863
Comments
To completely solve the disambiguation problem, I think we need some analysis at schema cache build time. So when starting up or on a NOTIFY we could say:
Otherwise these errors will only be discovered at runtime. |
On second thought, the runtime embedded disambiguation has its uses. But it definitely cannot handle recursive m2m without complicating the syntax. So as a first step we can deprecate target disamb and leave hint disamb documented . |
I believe we're in a much better state now that the docs have been revamped to mention Foreign Key Joins explicitly: https://postgrest--666.org.readthedocs.build/en/666/references/api/resource_embedding.html#foreign-key-joins The need to specify the FK constraint is much more understandable now: https://postgrest--666.org.readthedocs.build/en/666/references/api/resource_embedding.html#foreign-key-joins-on-multiple-foreign-key-relationships Computed relationships are still needed for recursive relationships, but pretty much every other corner case can be addressed with the |
Also want to mention that thanks to the nice Users are able to solve their issues by just following the hint and they specify the FK as seen on this supabase issue |
Problem
Edit: Decided below to only deprecate target disambiguation.
Embedding disambiguation is complex and it can fail in surprising ways (#2862).
Adding more syntax (#2448) would further complicate matters.
Solution
Deprecate Embedding Disambiguation and document all edge cases here using computed relationships. Can be done on the next minor release.
(WIP, needs more thinking) Remove the
300 Multiple Choices
error message/hints. Disambiguating should be a server side concern only. Maybe we can log tostderr
each time embedding is possible but needs a computed rel.Remove the disambiguation feature. Should be after 2 major releases.
This way we keep resource embedding simple (works for simple relationships OOTB) and avoid many errors. Computed relationships are much more predictable/understandable.
The text was updated successfully, but these errors were encountered: