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

Simple INSERT generates wrong struct field #3626

Open
kestrel-one opened this issue Oct 2, 2024 · 0 comments
Open

Simple INSERT generates wrong struct field #3626

kestrel-one opened this issue Oct 2, 2024 · 0 comments

Comments

@kestrel-one
Copy link

kestrel-one commented Oct 2, 2024

Version

1.27.0

What happened?

Using a function in the VALUES clause of an INSERT statement breaks struct field name generation.

Database schema

CREATE TABLE authors (
  name text NOT NULL,
  age integer NOT NULL
);

SQL queries

-- name: CreateAuthor :exec
INSERT INTO authors (name, age) VALUES (lower($1), $2);
type CreateAuthorParams struct {
	Lower string
	Age   int32
}

Playground URL

https://play.sqlc.dev/p/8c26a35b2d5baa341e8aa150d4072e679c1fe28c901c0bdc6830adf988e20661

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@kestrel-one kestrel-one added the bug Something isn't working label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant