Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Postgres: panic: unknown field type USER-DEFINED #23

Open
veqryn opened this issue Sep 3, 2024 · 1 comment
Open

Postgres: panic: unknown field type USER-DEFINED #23

veqryn opened this issue Sep 3, 2024 · 1 comment

Comments

@veqryn
Copy link

veqryn commented Sep 3, 2024

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/sqlingo@v0.13.1/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
);
@VarusHsu
Copy link
Contributor

VarusHsu commented Sep 4, 2024

Sqlingo not support well to postgres many complex type so far. It's still in experimental stage. But welcome giving more ideas or advises. @veqryn

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants