Skip to content
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

parser: Support columns from subselect statements #489

Merged
merged 1 commit into from
May 14, 2020

Conversation

maxhawkins
Copy link
Contributor

Fixes #467

@kyleconroy kyleconroy merged commit 19dda2b into sqlc-dev:master May 14, 2020
@peteole
Copy link

peteole commented Mar 29, 2022

Cool that it works, however there is still an issue when using joins in a subselect statement.
Take this example:

SELECT r.*
FROM (
        project_saves
        JOIN projects
        ON project_saves.project_id = projects.id
    ) r;

This fails with the message

# package sqlc
sql-queries/projects.sql:159:1: empty edit contents

sqlc seems to believe that thesubselect r has no columns since when selecting a field of r the error message is "column "id" does not exist". Is there an easy way to fix this?

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.

Columns not found when joining subquery
3 participants