Repository navigation
fix(postgrest): address a hinted embed by its table name outside the select list - #1962
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
…select list A relation with a foreign key hint and no alias was addressed by its hinted name in `order`, embedded filter names and embedded scopes. PostgREST matches those paths against the alias or table name only, so `order=users!fkey(username)` failed with PGRST100 and `messages!fkey.limit=1` was silently ignored. The hint now only appears in the select list. Also documents what a repeated `embedded()` call does to an earlier limit and offset, has the untyped `order()` merge through `appendOrderKey`, and tidies the migration guide snippet. Refs SDK-1758
0800e8f to
adcf87f
Compare
Summary
Follow-up to #1960, from a review of that PR.
A relation with a foreign key hint and no alias, such as a hand-written
PostgrestToOneRelation('users!messages_username_fkey', ...), was addressed by its hinted name everywhere outside theselectlist. PostgREST matches those paths against the alias or the table name only. Checked against the local stack:messages.limit=1messages!username.limit=1order=users(username).descorder=users!username(username).descOutside the
selectlist, the embed is now addressed by its alias, or by the table name without the hint. This fixesembedded()scopes, and also the to-oneorderkeys andembeddedFilterName, which had the same bug before #1960. Typegen always pairs a hint with an alias, so generated tables were not affected.Other changes
embedded()dartdoc now says exactly what a repeated call does: a later limit replaces only the limit, and a later range replaces both the offset and the limit.order()merges its key throughappendOrderKeyinstead of duplicating the merge logic.MIGRATION.md, the foreign key paragraph is back next to the relation text it explains, and the snippet is wrapped to 80 characters.Testing
melos analyzeanddcm analyzeare clean.Summary by CodeRabbit
Bug Fixes
Documentation