sqlboiler icon indicating copy to clipboard operation
sqlboiler copied to clipboard

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

Open netayg opened this issue 2 years ago • 5 comments

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.

netayg avatar Jul 03 '22 16:07 netayg

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

optiman avatar Jul 04 '22 11:07 optiman

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

netayg avatar Jul 04 '22 11:07 netayg

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

optiman avatar Jul 04 '22 12:07 optiman

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

netayg avatar Jul 05 '22 06:07 netayg

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

parnic avatar Sep 19 '22 01:09 parnic