When generating an update query using a WHERE ... IN id = ANY($1::TYPE[]) statement, I expected to get a function that have a named parameter based on the column in the query which is id, instead of getting id the result from generated function is Column1, see playground link
Current workarround,
I guess I can wrap the generated function manually, but will be better if this fixed, considered if this one is a legit bug, but if not please tell me where I went wrong
Thank you 🙇
Relevant log output
No response
Database schema
CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL,
bio text
);
SQL queries
-- name: UpdateAuthor :exec
UPDATE authors
SET name = $2
WHERE id = ANY($1::BIGSERIAL[]);
Version
1.18.0
What happened?
When generating an update query using a
WHERE ... IN id = ANY($1::TYPE[])
statement, I expected to get a function that have a named parameter based on the column in the query which isid
, instead of gettingid
the result from generated function isColumn1
, see playground linkCurrent workarround, I guess I can wrap the generated function manually, but will be better if this fixed, considered if this one is a legit bug, but if not please tell me where I went wrong
Thank you 🙇
Relevant log output
No response
Database schema
SQL queries
Configuration
No response
Playground URL
https://play.sqlc.dev/p/693bb4a6f7a05286b91f04bee63aae12cadbfaf5eab82e459b8886d0b2d8736f
What operating system are you using?
Linux, macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go