Is there more elegant way to infer enums?
This works:
type TransactionReason = (typeof transactionReasonEnum)['enumValues'][number]
But I wonder if Drizzle happen to have built-in way to infer TypeScript union from PostgreSQL enum.1 Reply
Made this utility type for myself:
export type EnumValues<T extends PgEnum<any>> = T['enumValues'] extends Array<infer U> ? U : never;