Skip to content

Star expansion failed for query #2915

Open

Description

@kyleconroy

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

Activity

  1. changed the title [-]Star example failed for query[/-] [+]Star expansion failed for query[/+] on Oct 25, 2023
  2. meghb commented on Dec 1, 2023

    @meghb

    @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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions