tareqimbasher / NetPad

A cross-platform C# editor and playground.
MIT License
1.25k stars 66 forks source link

PostgreSQL columns with custom enum types are not being derived. #94

Open antonklimov opened 11 months ago

antonklimov commented 11 months ago

The columns which have enum type in Postgres like CREATE TYPE t1 as ENUM ('V1', 'V2') do not appear in the generated schemas.

tareqimbasher commented 10 months ago

@antonklimov can you please provide a SQL script to reproduce the issue?

antonklimov commented 10 months ago

@tareqimbasher

CREATE TYPE t1 as ENUM ('V1', 'V2');
CREATE TABLE test1 (
    id int,
    enum_column t1

);
INSERT INTO test1 values (1, 'V1');
SELECT * FROM test1;
image
tareqimbasher commented 9 months ago

Update: It looks like EF Core's scaffolding tool skips ENUM type columns and does not generate CLR properties for them. Since NetPad uses the same EF Core tooling to scaffold your database, it will have the same limitations. I will keep this ticket open however as I believe we could still find a solution around this.