You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when a query is done with an alias in a select column and there is a group by clause using the alias, the code generation fails. This issue seems to be related with #1285
Relevant log output
column reference "alias" not found
Database schema
-- Example queries for sqlcCREATETABLEauthors (
id BIGSERIALPRIMARY KEY,
name textNOT NULL,
bio text,
type textNOT NULL
);
SQL queries
-- name: countWithCondition :manySELECT CASE WHEN type ='DECEASED' then false ELSE true END as alias, count(*) FROM authors
GROUP BY alias;
@TiagoVentosa hey I just built this from source and I don't see the error, however, when I go to version v1.11.0 (commit ad53cfe) I see the error you mentioned. So seems as though between the latest commit and version v1.11.0 the issue was fixed.
I'm attaching the results of sqlc when I build from source using the details you provided.
Version
1.11.0
What happened?
when a query is done with an alias in a select column and there is a group by clause using the alias, the code generation fails. This issue seems to be related with #1285
Relevant log output
column reference "alias" not found
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/3000f866b2534e1ea7cb0d107056a8ff20b8eddf5dbc0c748710c2a905afb98f
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: