Skip to content

Column expansion for quoted non-keyword identifier table does not work well #2575

Closed
@orisano

Description

@orisano

Version

1.20.0

What happened?

Column expansion for quoted non-keyword identifier table does not work well.

input:

SELECT "t".* FROM foo "t";

output:

SELECT t.c.* FROM t "t";

expected:

SELECT t.c FROM t "t";

or

SELECT "t".c FROM t "t";

Relevant log output

No response

Database schema

CREATE TABLE t (
  c BIGSERIAL PRIMARY KEY
);

SQL queries

-- name: Get :one
SELECT "t".* FROM t "t";

Configuration

{
  "version": "1",
  "packages": [
    {
      "path": "db",
      "engine": "postgresql",
      "schema": "query.sql",
      "queries": "query.sql"
    }
  ]
}

Playground URL

https://play.sqlc.dev/p/5532492abf710a8a93ef6fcd72236d0166347c85315ef11da8fcd3a12d67c7f9

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNew issues that hasn't been reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions