RobinBlomberg / kysely-codegen

Generate Kysely type definitions from your database.
MIT License
773 stars 69 forks source link

`--runtime-enums` flag seems to be broken #202

Open araguma opened 2 weeks ago

araguma commented 2 weeks ago

I created an enum in Postgres using create type "Schema"."ClaimTypeEnum" as enum ('Institutional', 'Professional')

and referenced it in Kysely with sql.id('Schema', 'ClaimTypeEnum')

but when I run npx kysely-codegen --runtime-enums, I get

export interface Table {
    ClaimType: "Institutional" | "Professional";
}

instead of something like

export enum ClaimTypeEnum {
    INSTITUTIONAL = 'Institutional',
    PROFESSIONAL = 'Professional',
}
export interface Table {
    ClaimType: ClaimTypeEnum
}

For context, I'm using Postgres 16.4, and kysely-codegen 0.16.8.

Upvote & Fund

Fund with Polar