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

fix(engine/sqlite): fix table_alias rules #2465

Merged
merged 4 commits into from
Jul 24, 2023
Merged

Conversation

orisano
Copy link
Contributor

@orisano orisano commented Jul 15, 2023

fix #2271

In the current grammar, the LEFT part of LEFT JOIN was recognized as table_alias.

lemon has a fallback directive that treats it as a KEYWORD and treats it as an identifier if parsing fails.
ref: https://sqlite.org/src/doc/trunk/doc/lemon.html#pfallback

The rule has been modified to match this behavior.
Add a table_alias_fallback rule that also includes KEYWORD to lower the precedence to match SQLite's behavior.

changed rules to conform to fallback directive behavior

fix sqlc-dev#2271
@kyleconroy kyleconroy merged commit c236b74 into sqlc-dev:main Jul 24, 2023
7 checks passed
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.

sqlite: column "id" does not exist for left-joined query
2 participants