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

Invalid go generated code when there's only one field and it's named "q" #3627

Open
lsmoura opened this issue Oct 2, 2024 · 0 comments · May be fixed by #3647
Open

Invalid go generated code when there's only one field and it's named "q" #3627

lsmoura opened this issue Oct 2, 2024 · 0 comments · May be fixed by #3647

Comments

@lsmoura
Copy link

lsmoura commented Oct 2, 2024

Version

1.27.0

What happened?

The generated function func (q *Queries) GetAuthorWithQ(ctx context.Context, q sql.NullString) ([]Author, error) has both a q struct and q parameter, which is invalid go syntax.

Relevant log output

No response

Database schema

CREATE TABLE authors (
  id   BIGSERIAL PRIMARY KEY,
  name text      NOT NULL,
  bio  text,
  q    text
);

SQL queries

-- name: GetAuthorWithQ :many
SELECT * FROM authors
WHERE q = $1
ORDER BY name;

Configuration

No response

Playground URL

https://play.sqlc.dev/p/ba6e22e495b02c910c219f86bc6b9b145bbf2af16fff7913059fdb26889b4ec3

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@lsmoura lsmoura added the bug Something isn't working label Oct 2, 2024
@vitords vitords linked a pull request Oct 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant