drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: Integrate DB Constraints into Drizzle-Zod

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

Description

### Feature hasn't been suggested before.

- [x] I have verified this feature I'm about to request hasn't been suggested before.

### Describe the enhancement you want to request

I’m currently finding that Zod schemas generated with drizzle-zod require me to re-implement the same constraint checks that already exist in my database, using refine. Ideally, drizzle-zod would incorporate these database constraints directly, avoiding duplicated boilerplate and ensuring a single source of truth.

Contributor guide

Open the contributing guide

Research direction

Start by examining drizzle-zod's schema-generation entry point and how database constraints are represented for the supported SQL dialects. Define which constraints should be reflected in generated Zod schemas, then verify that users no longer need to duplicate those checks with refine.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, typescript
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.