Closed danielbprice closed 1 year ago
Uhh, also, I realize that sometimes the code above is outputing JSONB and sometimes a string-- that's because I was rapidly simplifying a more complicated example. The bug persists even with this corrected. š¤¦
https://play.sqlc.dev/p/fb3aadb5e1035fb69e97e96cfb2e3be9eaf3bedd156f04ab604987353de4ddec
Version
Other
What happened?
With version 1.19.0, sqlc gets confused when I have two parts of a UNION query emit a column with the same alias, like this:
Here is a demonstration of the problem: https://play.sqlc.dev/p/03c0103fb5161edafab0acdaf7bfa7c31ece807e2477305e2719452b6760ed7e
Here it is working: https://play.sqlc.dev/p/e9d330cf86921afa1e5ce6cc6fbe5711f9e3289e2eaa34bb6da72398c533c6cd
The error message talks about
strict_order_by
, but I don't really want to turn off all of the validation of ORDER BY clauses in my project. Also, I couldn't find a reference to this parameter in the documentation.Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/03c0103fb5161edafab0acdaf7bfa7c31ece807e2477305e2719452b6760ed7e
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go