Skip to content

Escape constant names in queries#4525

Open
snprajwal wants to merge 1 commit into
sqlc-dev:mainfrom
snprajwal:use-any
Open

Escape constant names in queries#4525
snprajwal wants to merge 1 commit into
sqlc-dev:mainfrom
snprajwal:use-any

Conversation

@snprajwal

@snprajwal snprajwal commented Jul 26, 2026

Copy link
Copy Markdown

The any keyword was introduced in Go 1.18, and can be used in place of interface{}. This was not in the list of reserved keywords, leading to identifiers using this term in generated code.

Update the logic to escape constant names, and also add any to the list of reserved keywords.

This is a minimal rebased version of #3961, which I'm unable to reopen. It only contains the changes that fix invalid code generation.

The `any` keyword was introduced in Go 1.18, and can be used in place
of `interface{}`. This was not in the list of reserved keywords, leading
to identifiers using this term in generated code.

Update the logic to escape constant names, and also add `any` to the
list of reserved keywords.

Signed-off-by: Prajwal Nadig <prajwalnadig21@gmail.com>
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