© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•14mo ago•
7 replies
Reyesjon

Cannot generate Typebox schema from Drizzle Enum

i just trying to do the same thing as show in the docs here: https://orm.drizzle.team/docs/typebox#select-schema

so i just copy and paste this from the docs:
import { pgEnum } from "drizzle-orm/pg-core";
import { pgEnum } from "drizzle-orm/pg-core";

import { createInsertSchema } from 'drizzle-typebox'
import { createInsertSchema } from 'drizzle-typebox'

const roles = pgEnum('roles', ['admin', 'basic']);
const roles = pgEnum('roles', ['admin', 'basic']);

const rolesSchema = createSelectSchema(roles);
const rolesSchema = createSelectSchema(roles);


However, i got this error at
createSelectSchema(roles)
createSelectSchema(roles)
:
Argument of type 'PgEnum<["admin", "basic"]>' is not assignable to parameter of type 'Table<TableConfig<Column<any, object, object>>>'.

Type 'PgEnum<["admin", "basic"]>' is missing the following properties from type 'Table<TableConfig<Column<any, object, object>>>': _, $inferSelect, $inferInsert, getSQLts(2345)

version:
"drizzle-orm": "^0.38.2",
"drizzle-typebox": "^0.2.0",
Drizzle ORM - drizzle-typebox
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
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

Drizzle typebox enum array not working
Drizzle TeamDTDrizzle Team / help
3y ago
Ensure Drizzle findMany conforms to Typebox schema
Drizzle TeamDTDrizzle Team / help
3y ago
drizzle-kit generate with dynamic Schema
Drizzle TeamDTDrizzle Team / help
2y ago
Cannot run "drizzle-kit generate" anymore
Drizzle TeamDTDrizzle Team / help
11mo ago