drizzle-team / drizzle-team/drizzle-orm

[BUG]: drizzle-orm/zod .omit() and .pick() produce 'Type true is not assignable to type never' in 1.0.0-beta.20

Open
#5,539 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

## What version of `drizzle-orm` are you using?

1.0.0-beta.20

## What version of `zod` are you using?

Tested with both zod@3.25.76 and zod@4.3.6

## Describe the Bug

The built-in `drizzle-orm/zod` (which replaces the deprecated `drizzle-zod`) has the same TypeScript type error as the old package when using `.omit()` or `.pick()` on schemas returned by `createInsertSchema()`.

```typescript
import { createInsertSchema } from 'drizzle-orm/zod';
import { events } from './schema';
import { z } from 'zod';

const eventInsert = createInsertSchema(events, {
duration: z.coerce.number().int().min(1),
});

// TS2322: Type 'true' is not assignable to type 'never'.
const createEvent = eventInsert.omit({ id: true, createdAt: true });

// Same error with .pick():
const picked = eventInsert.pick({ duration: true, eventType: true });
```

The **runtime works correctly** — the schemas validate as expected. The error is purely at the TypeScript type level.

This is the same issue as #4453 (which was filed against the deprecated `drizzle-zod` package), but now reproduced with the built-in `drizzle-orm/zod` in the 1.0 beta.

## Expected behavior

`.omit()` and `.pick()` should accept `{ key: true }` without TypeScript errors, matching the standard Zod API.

## Environment & setup

- drizzle-orm: 1.0.0-beta.20
- zod: 3.25.76 and 4.3.6 (both affected)
- TypeScript: 5.9.3
- SQLite (better-sqlite3) with drizzle-orm/better-sqlite3

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.