Closed lintellme99 closed 3 months ago
All my enums in PostgreSQL are generated into type
enum
PostgreSQL
type
For example, PostgreSQL:
CREATE TYPE "app_status" AS ENUM ( 'running', 'not_started', 'down' );
Becomes:
export type AppStatuses = | 'running' | 'not_started' | 'down'
After codegen
codegen
Is it possible to generate enum as enum? For example:
export enum AppStatuses { RUNNING = 'running', NOT_STARTED = 'not_started', DOWN = 'down' }
I want to use it as a:
if (app_status === AppStatuses.DOWN) { ... }
Hello! You can use the --runtime-enums to generate them. ✨
--runtime-enums
Thank you so much! I've dig a little deeper and found the solution, but you were literally faster
Thank you so much!
All my
enum
s inPostgreSQL
are generated intotype
For example,
PostgreSQL
:Becomes:
After
codegen
Is it possible to generate
enum
asenum
? For example:I want to use it as a:
Upvote & Fund