Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Sep 3, 2025

Update joins with SubqueryAlias with TableAlias matching an outer TableAlias would result in the incorrect table getting picked when resolving Foreign Keys. Fix here is to not Inspect OpaqueNodes to avoid incorrectly overriding any aliases; they shouldn't be visible anyway.

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

Looks great! 🙌🏻

Comment on lines +104 to +106
// TODO: We should change transform.Inspect to not walk the children of sql.OpaqueNodes (like transform.Node)
// and add a transform.InspectWithOpaque that does.
// Using transform.Node here achieves the same result without a large refactor.
Copy link
Contributor

Choose a reason for hiding this comment

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

Great observation/TODO. There are several small inconsistencies in the transform.* functions that would be great to tidy up one day.

@jycor jycor merged commit d34f9de into main Sep 3, 2025
8 checks passed
@jycor jycor deleted the james/updatejoin branch September 3, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants