sqlc-dev/sqlc

Simple INSERT generates wrong struct field

kestrel-one opened this issue · 0 comments

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