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
From working on #2449 I discovered that sqlc doesn't handle some valid queries with function calls like current_date in FROM clauses correctly. I have only tried this with postgresql, but a similar issue may be present for other engines.
For the query SELECT * FROM current_date; sqlc generates a function returning a struct with no fields, which is of course not the desired result.
For the query SELECT date FROM current_date AS date; (which is perfectly valid) sqlc just prints an error:
query.sql:2:8: column "date" does not exist
Here's psql output for that query:
postgres=# SELECT date FROM current_date AS date;
date
------------
2023-07-13
(1 row)
Version
Other
What happened?
From working on #2449 I discovered that sqlc doesn't handle some valid queries with function calls like
current_date
in FROM clauses correctly. I have only tried this with postgresql, but a similar issue may be present for other engines.For the query
SELECT * FROM current_date;
sqlc generates a function returning a struct with no fields, which is of course not the desired result.For the query
SELECT date FROM current_date AS date;
(which is perfectly valid) sqlc just prints an error:query.sql:2:8: column "date" does not exist
Here's psql output for that query:
Relevant log output
No response
Database schema
No response
SQL queries
Configuration
No response
Playground URL
No response
What operating system are you using?
Linux
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: