Skip to content

Star expansion failed for query #2915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kyleconroy opened this issue Oct 25, 2023 · 1 comment
Open

Star expansion failed for query #2915

kyleconroy opened this issue Oct 25, 2023 · 1 comment

Comments

@kyleconroy
Copy link
Collaborator

Version

1.23.0

What happened?

Generating code for a query with star expansion didn't work.

Relevant log output

# package db
query.sql:1:1: star expansion failed for query

Database schema

No response

SQL queries

WITH total AS (
    WITH a AS (
    	SELECT 1 AS col1, 2 AS col2
    ),
    b AS (
    	SELECT 1 AS col1, 3 AS col3
    )
    SELECT *
    FROM a
    FULL JOIN b USING (col1)
)
SELECT * FROM total;

Configuration

version: "2"
cloud:
  project: "<PROJECT_ID>"
sql:
- schema: "schema.sql"
  queries: "query.sql"
  engine: "postgresql"
  database:
    managed: true
  gen:
    go:
      out: db
      sql_package: "pgx/v5"

Playground URL

https://play.sqlc.dev/p/4f4fbdba61dc9fc8a64a5c57f71e814e56183baf46966d254864f5dc3b0d2c4c

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@kyleconroy kyleconroy added bug Something isn't working triage New issues that hasn't been reviewed 📚 postgresql 🔧 golang 💻 darwin analyzer/db and removed triage New issues that hasn't been reviewed labels Oct 25, 2023
@kyleconroy kyleconroy changed the title Star example failed for query Star expansion failed for query Oct 25, 2023
@meghb
Copy link

meghb commented Dec 1, 2023

@kyleconroy thanks for the great work. do we have any update on when this can be fixed? We have a lot of CTEs with star queries and it would help if this is fixed, we are currently having to expand out the queries which is less than ideal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants