Skip to content

omit_unused_structs ignore enums when it is referenced in an array #3978

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
pengux opened this issue Jun 2, 2025 · 0 comments
Open

omit_unused_structs ignore enums when it is referenced in an array #3978

pengux opened this issue Jun 2, 2025 · 0 comments

Comments

@pengux
Copy link

pengux commented Jun 2, 2025

Version

1.29.0

What happened?

When omit_unused_structs is set, it doesn't generate the Go type for a Postgresql ENUM if the enum is referenced in a table as an array

Relevant log output

Database schema

CREATE TYPE enum_type AS ENUM('a','b');

CREATE TABLE foobar (
  types enum_type[] not null
);

SQL queries

-- name: List :many
SELECT * FROM foobar;

Configuration

{
  "version": "2",
  "sql": [{
    "schema": "schema.sql",
    "queries": "query.sql",
    "engine": "postgresql",
    "gen": {
      "go": {
        "out": "db",
        "omit_unused_structs": true
      }
    }
  }]
}

Playground URL

https://play.sqlc.dev/p/0c1fceceeca7b3984de0cf7b28872931ca121211a8ba25c21e11e802b44dea59

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@pengux pengux added the bug Something isn't working label Jun 2, 2025
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

1 participant