Skip to content

Conversation

lorenz
Copy link

@lorenz lorenz commented Oct 15, 2023

This prevents rangeVars (now rawRangeTblRefs) from descending into subqueries, which caused it to look at table references not in this query's scope.

It also renames this function and makes it extract all relevant table definition AST nodes instead of just RangeVars. It then passes these to resolveCatalogRefs.

resolveCatalgoRefs now also rejects attempts to use sqlc.embed with ad-hoc-defined tables (function outputs and subqueries) as their outputs do not have corresponding model types. Previously this generated broken code.

This prevents rangeVars (now rawRangeTblRefs) from descending into
subqueries, which caused it to look at table references not in this
query's scope.

It also renames this function and makes it extract all relevant table
definition AST nodes instead of just RangeVars. It then passes these to
resolveCatalogRefs.

resolveCatalgoRefs now also rejects attempts to use sqlc.embed with
ad-hoc-defined tables (function outputs and subqueries) as their outputs
do not have corresponding model types. Previously this generated broken
code.
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.

1 participant