© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
5 replies
tunisoft

Typescript enum to pgEnum

I have this code
export enum field_types {
    numeric = 'numeric',
    text = 'text',
    textarea = 'textarea',
    select = 'select'
}

export const typeEnum = pgEnum('type', Object.values(field_types));
export enum field_types {
    numeric = 'numeric',
    text = 'text',
    textarea = 'textarea',
    select = 'select'
}

export const typeEnum = pgEnum('type', Object.values(field_types));

But it shows this error
CleanShot_2023-08-07_at_22.13.322x.png
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

PGEnum -> Typescript Enum
Drizzle TeamDTDrizzle Team / help
3y ago
Any easy way to create a typescript ENUM type from pgEnum?
Drizzle TeamDTDrizzle Team / help
3y ago
varchar but cast to typescript enum?
Drizzle TeamDTDrizzle Team / help
3y ago
enum created using pgEnum is shown as not a function
Drizzle TeamDTDrizzle Team / help
4mo ago