sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

fix: escape constant names in queries

Open snprajwal opened this issue 8 months ago • 3 comments

Constant names in queries were not escaped, leading to keywords being emitted as constant names in the generated output. This has been updated to be escaped, and any has been added as a reserved keyword as of Go 1.18.

This also addresses the lint raised by gopls on sqlc's generated Go files for modernizing the usage of an empty interface for the any type.

snprajwal avatar May 13 '25 14:05 snprajwal

Interesting, it looks like the generated names for constants are not escaped

snprajwal avatar May 13 '25 16:05 snprajwal

@kyleconroy I just realised this might be noisier than needed, since the linter ignores generated files. Would you want me to split the bug fix out into a separate PR and close this?

snprajwal avatar May 30 '25 20:05 snprajwal

@kyleconroy gentle ping, this fixes an actual bug, I've renamed the PR to better reflect that :)

snprajwal avatar Nov 21 '25 11:11 snprajwal