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

feat(analyzer): Return zero values when encountering unexpected ast nodes #3069

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

andrewmbenton
Copy link
Collaborator

This allows users to run generate on any parsable query, even when sqlc doesn't understand it.

Closes #2377

…odes

This allows users to run generate on any parseable query, even
when sqlc doesn't understand it.

Closes #2377
@andrewmbenton
Copy link
Collaborator Author

I think we need to think this through a little more. The vet_failures test adjustment hints at the fact that we are now adding queries to the compiler result (and codegenrequest) that we weren't previously, because they were "unsupported". We are doing this even though the queries don't have any annotation, which is perhaps unexpected.

@kyleconroy
Copy link
Collaborator

We are doing this even though the queries don't have any annotation, which is perhaps unexpected.

I do think this is an unexpected behavior change. What do you think about ignoring queries that don't have an annotation? I think that feels like the expected behavior.

@andrewmbenton
Copy link
Collaborator Author

What do you think about ignoring queries that don't have an annotation? I think that feels like the expected behavior.

Yeah I had implemented that initially, and I think it's correct. It will change a decent amount of test output though so I would do it in a separate PR.

I could also argue that this isn't that big of a change, since we must have been adding un-annotated queries to codegen requests all along, but only if they were "supported."

@andrewmbenton andrewmbenton marked this pull request as ready for review December 20, 2023 00:01
@andrewmbenton andrewmbenton merged commit 55f3250 into main Dec 20, 2023
8 checks passed
@andrewmbenton andrewmbenton deleted the andrew/permissive-exec branch December 20, 2023 00:10
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.

None yet

2 participants