volatiletech / sqlboiler

Generate a Go ORM tailored to your database schema.
BSD 3-Clause "New" or "Revised" License
6.66k stars 539 forks source link

Enums are not generated (even when valid with only [a-z] letters) #1157

Open netayg opened 2 years ago

netayg commented 2 years ago

Enums are not generated (even when valid with only [a-z] letters)

What version of SQLBoiler are you using (sqlboiler --version)?

$ sqlboiler --version
SQLBoiler v4.11.0

Installed today, July 3th 2022.

What is your database and version (eg. Postgresql 10)

$ brew info postgres
postgresql: stable 14.4 (bottled), HEAD

If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)

$ sqlboiler --wipe --add-enum-types psql

Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)

CREATE TYPE public.example AS ENUM
    ('abc', 'def');

ALTER TYPE public.example
    OWNER TO postgres;

I updated SQL Boiler as per the documentation aka ran

go install github.com/volatiletech/sqlboiler/v4@latest
go install github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql@latest

Any help would be appreciated.

optiman commented 2 years ago

Do you use this enum type in at least one table? Otherwise it wouldn't be generated.

netayg commented 2 years ago

Yes i am, as an array of type "example[]"

optiman commented 2 years ago

Enum arrays aren't implemented yet. Technically, it's a completely separate data type.

netayg commented 2 years ago

I see.. that's a shame. Well I guess I'll have to just deal with it 🥇

parnic commented 1 year ago

Duplicate of https://github.com/volatiletech/sqlboiler/issues/739 ?