Automatically generate Valibot validation schemas from Drizzle ORM table definitions. Current stable version 0.4.2, released in September 2024, with active development following Drizzle ORM releases. It bridges Drizzle's schema-first approach with Valibot's runtime validation, eliminating duplicated schema definitions. Unlike alternatives like drizzle-zod, it uses Valibot's composable and type-safe API. Requires Valibot >=1.0.0-beta.7 and Drizzle ORM >=0.36.0 as peer dependencies. Ships TypeScript types and supports PostgreSQL, MySQL, and SQLite.
npm install drizzle-valibotNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Drizzle table, generates Valibot schemas for insert and select, and validates an insert.
Upgrade Valibot to version 1.0.0-beta.7 or later.
Upgrade Drizzle ORM to version 0.36.0 or later.
Change import to 'drizzle-valibot/pg'.
Define tables using Drizzle's 'createTable' or 'pgTable' before using 'createSchema'.
Use 'InferInputType' and 'InferOutputType' from 'drizzle-valibot'.
Run 'npm install drizzle-valibot' and ensure peer dependencies are installed.
Change to 'import { createSchema } from 'drizzle-valibot''.Define the table using Drizzle's table builder before calling 'createSchema'.
Ensure all 'notNull' fields are provided in the parsed data.