sqlingo icon indicating copy to clipboard operation
sqlingo copied to clipboard

Postgres: panic: unknown field type USER-DEFINED

Open veqryn opened this issue 5 months ago • 1 comments

Attempting to use the generate executable on a simple postgres database. sqlingo-gen-postgres postgresql://postgres:password@localhost:5432/dbname?sslmode=disable > ./internal/gen_models.go gives:

Generating code for tables...
panic: unknown field type USER-DEFINED

goroutine 1 [running]:
main.main()
        /Users/person/go/pkg/mod/github.com/lqs/[email protected]/sqlingo-gen-postgres/main.go:12 +0x90

The database schema:

CREATE TYPE COLORS AS ENUM('red', 'green', 'blue');

CREATE TABLE accounts (
    id          BIGSERIAL PRIMARY KEY,
    name        VARCHAR(50)              NOT NULL,
    email       VARCHAR(50) UNIQUE       NOT NULL,
    active      BOOLEAN                  NOT NULL,
    fav_color   COLORS,
    fav_numbers INTEGER[],
    properties  JSONB,
    created_at  TIMESTAMP WITH TIME ZONE NOT NULL
);

veqryn avatar Sep 03 '24 23:09 veqryn