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:
However, i got this error at
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",
so i just copy and paste this from the docs:
import { pgEnum } from "drizzle-orm/pg-core";import { createInsertSchema } from 'drizzle-typebox'const roles = pgEnum('roles', ['admin', 'basic']);const rolesSchema = createSelectSchema(roles);However, i got this error at
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 is a lightweight and performant TypeScript ORM with developer experience in mind.