At the moment kysely-codegen
is not introspecting checks in postgres dialect.
Following table:
CREATE TABLE "example" (
"id" bigserial PRIMARY KEY,
"status" text CHECK ("status" IN ("public", "restricted", "private")) NOT NULL DEFAULT "restricted",
)
becomes
export interface Example {
id: Generated<Int8>;
status: Generated<string>;
}
while it should be
export interface Example {
id: Generated<Int8>;
status: Generated<'public' | 'restricted' | 'private'>;
}
I didn't take a look at the codebase yet, so if you could point me to the right direction I could implement that. Thanks!
ps. useful take on ENUMS vs CHECKS https://stackoverflow.com/a/10984951/11060504
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too