Generates Typebox JSON Schema validation schemas directly from Drizzle ORM table definitions. As of v0.3.3, it works with Drizzle ORM >=0.36.0 and Typebox >=0.34.8. This eliminates duplication between database schema defined in Drizzle and runtime validation schemas, ensuring single-source-of-truth for types and validation. Compared to alternatives like Zod or Yup, Typebox offers faster validation and smaller bundles, making it ideal for performance-critical environments. The package is maintained by the Drizzle team with regular releases aligned with Drizzle ORM updates.
npm install drizzle-typeboxNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates Typebox insert and select schemas from a Drizzle PostgreSQL table definition.
Use import syntax or switch to an older version if CJS is required.
Use `typeboxTableToTypes` instead.
Use `const { buildInsertSchema } = drizzleTypebox();` not `import { drizzleTypebox } from ...` then direct call.Ensure all columns used in generated schemas have names defined in the Drizzle table.
Change to import syntax: `import { drizzleTypebox } from 'drizzle-typebox'` or set `type: 'module'` in package.json.Call the function: `const { buildInsertSchema } = drizzleTypebox();`Install peer dependency: `npm install @sinclair/typebox`