Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
@pengux

Description

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

        AltStyle によって変換されたページ (->オリジナル) /