CLI and programmatic tool to generate static Zod schema files from Drizzle ORM table definitions. Current version 0.2.0, actively maintained with weekly releases. Differs from runtime drizzle-zod adapters by emitting inspectable, version-controllable .zod.ts files that can be tree-shaken. Supports PostgreSQL, MySQL, SQLite, SingleStore, and expands Zod constructs (discriminated unions, intersections, pipelines, readonly, symbol, NaN, catch). Handles SelectSchema, InsertSchema, UpdateSchema variants. Requires Node >=18, peer dependencies drizzle-orm >=0.36.0 and zod ^3.25.0 || ^4.0.0.
npm install drizzle-zod-codegenNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generate static Zod schema files from Drizzle ORM table schemas using the CLI or programmatic API.
Replace with deterministic defaults like .default('hello') or post-process the generated .zod.ts file to add the dynamic default manually.Use `--output single` explicitly; ensure you are on latest version.
Avoid using those constructs in Drizzle schemas if you need full codegen support; or post-process the generated file.
Switch to ESM imports or use dynamic import() if needed in CJS project.
Import from 'drizzle-zod-codegen/generator' explicitly.
Run `npm install -D drizzle-zod-codegen` (or pnpm/yarn equivalent). Ensure it is in devDependencies.
Remove or replace z.function() from your Drizzle schema; or post-process the generated .zod.ts file to add the function manually.
Replace with a static default value like `.default('hello')`, or post-process after generation.Run `npm install drizzle-orm` (version >=0.36.0).