Skip to content

Commit

Permalink
fix(golang): escape q field name
Browse files Browse the repository at this point in the history
  • Loading branch information
vitords committed Oct 9, 2024
1 parent 695d9a1 commit d7bd20c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
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
);

0 comments on commit d7bd20c

Please sign in to comment.