Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

If a query includes a star reference, error if we're unable to expand that reference. The new analyzer will happily anaylyze that code. If executed at runtime, these queries could change values.

Fixes #2880

If a query includes a star reference, error if we're unable to expand
that reference. The new analyzer will happily anaylyze that code. If
executed at runtime, these queries could change values.
@kyleconroy kyleconroy merged commit 72c08a4 into main Oct 19, 2023
@kyleconroy kyleconroy deleted the kyle/verify-star-expansion branch October 19, 2023 15:50
@prog8
Copy link

prog8 commented Oct 18, 2024

Hi @kyleconroy,

I'm experiencing an issue with sqlc when trying to infer the schema solely from my database, without relying on schema files. The reason for this approach is that Postgres supports a wide range of features, including function overloading, which can be challenging for sqlc to fully support.

When I attempt to fetch data using a query like SELECT * FROM table, I encounter an error stating star expansion failed for query. However, if I comment out the line that triggers this error, everything works as expected.

I'm wondering if there's a workaround or a nice way to handle the star expansion feature in this scenario. Any guidance would be greatly appreciated.

Thanks in advance.

alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
* fix(analyzer): Error on unexpanded star expression

If a query includes a star reference, error if we're unable to expand
that reference. The new analyzer will happily anaylyze that code. If
executed at runtime, these queries could change values.

* Update config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants