Skip to content

array column added from alter table are generated as non array #2571

Closed
@Andy-William

Description

@Andy-William

Version

1.20.0

What happened?

On alter tables, array columns are generated as non array. This doesn't happen in 1.19.

image

Relevant log output

No response

Database schema

-- Example queries for sqlc
CREATE TABLE authors (
  id   BIGSERIAL PRIMARY KEY,
  name text      NOT NULL,
  array1 BIGINT[],
  array2 BIGINT array
);

ALTER TABLE authors ADD COLUMN array3 BIGINT[];
ALTER TABLE authors ADD COLUMN array4 BIGINT array;

SQL queries

-- name: GetAuthor :one
SELECT * FROM (select id from authors) t;

Configuration

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

Playground URL

https://play.sqlc.dev/p/09d13d4e8c68bda99da95e6e0af5adf85c60396277614faae148fd8b56a9dec4

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