Skip to content
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

Array of enum type is generated as a single enum value #2610

Closed
roskee opened this issue Aug 14, 2023 · 2 comments
Closed

Array of enum type is generated as a single enum value #2610

roskee opened this issue Aug 14, 2023 · 2 comments
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@roskee
Copy link

roskee commented Aug 14, 2023

Version

1.20.0

What happened?

This is a bug introduced on v1.20.0. It works as expected on v1.19.0

This is the schema I was trying to create

ALTER TABLE some_table ADD COLUMN my_columns custom_enum_type[] NOT NULL;

sqlc generated the model for the above table as follows

type SomeTable struct {
    // ... other columns
    MyColumns CustomEnumType
}

But since my_columns is an array I expected MyColumns field to be []CustomEnumType.
I have created a sample on sqlc playground.

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

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

Playground URL

https://play.sqlc.dev/p/6310bb377a5dede9cb442c99ced56ef83e97414bb4b8e3dc97edb38191cf8477

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@roskee roskee added bug Something isn't working triage New issues that hasn't been reviewed labels Aug 14, 2023
@orisano
Copy link
Contributor

orisano commented Aug 14, 2023

@roskee This problem has already been solved by #2572 (not yet released)

@roskee
Copy link
Author

roskee commented Aug 14, 2023

Okay. I am closing the issue.

@roskee roskee closed this as completed Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

2 participants