-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix nested fields relationships (#564)
### What Selecting nested field relationships had a bug where it would try to look up a composite type field column in the parent collection. For example: I have a collection `institution` with a field `staff` that is a composite type that contains the field `favorite_artist_id`. Trying to have a relationship from this field to the `Artist` table would attempt to look-up this field in `institution`, instead of in `staff`. This PR fixes this. ### How Before, we had a type called `TableNameAndReference` that describe the metadata name of a table and held a (relationship alias) reference to it. - We modify this type to contain a `Source` instead of a `Name`, which can be a collection name or a nested field name. This is done so it is clearer whether we are tracking a collection or a type. - Instead of looking up a `Collection` everywhere, we lookup /anything/ that can have fields by replacing `lookup_collection` with `lookup_fields_info`. - When translating nested fields, instead of passing the `joins` accumulator for the parent table, we create another on the fly, and translate the joins using the table created for the nested field instead of the parent table. We also: - Create nicer aliases for nested fields so they are easier to track - Add a test that is based on sql tables from the `v3-engine`, so we add a new `sql` file and update the configurations accordingly.
- Loading branch information
Gil Mizrahi
committed
Aug 12, 2024
1 parent
91a6a39
commit 346d2db
Showing
32 changed files
with
5,926 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.