Skip to content

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

Open
@pengux

Description

@pengux

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

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