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(golang): escape q field name #3647

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/codegen/golang/reserved.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ func IsReserved(s string) bool {
return true
case "var":
return true
case "q":
return true
default:
return false
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ SELECT sqlc.arg('return')::text;
-- name: KeywordVar :exec
SELECT sqlc.arg('var')::text;

-- name: KeywordQ :exec
SELECT sqlc.arg('q')::text;

-- name: SelectBreak :one
SELECT "break" FROM go_keywords;

Expand Down Expand Up @@ -147,3 +150,6 @@ SELECT "return" FROM go_keywords;

-- name: SelectVar :one
SELECT "var" FROM go_keywords;

-- name: SelectQ :one
SELECT "q" FROM go_keywords;
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ CREATE TABLE go_keywords (
"for" TEXT,
"import" TEXT,
"return" TEXT,
"var" TEXT
"var" TEXT,
"q" TEXT
);
Loading