Requires
[email protected] or higher for full compatibility with identity columns and type safety.Installation
drizzle-orm installed:
Quick Start
Generate 10 users with random data:How It Works
Deterministic Data Generation
Drizzle Seed uses a pseudorandom number generator (pRNG) initialized with a seed value. The same seed always produces the same sequence of data:- Consistency - Tests run on identical data every time
- Debugging - Reproduce bugs with the same data set
- Collaboration - Team members share seed values for consistent data
Automatic Type Inference
Drizzle Seed analyzes your schema and generates appropriate data for each column type:Basic Usage
Specify Count
Generate a specific number of records:Set Seed Value
Use different seeds for different data sets:Advanced Usage with Refinements
Customize data generation with therefine method:
Generator Functions
Drizzle Seed provides extensive generator functions:String Generators
Number Generators
Date and Time Generators
Special Generators
Custom Values
Unique Generators
Generate unique values:Seeding Related Data
Generate data for tables with relationships:Weighted Relationships
Create varied relationship counts:Reset Database
Clear and reseed your database:Common Patterns
E-commerce Example
Blog Platform Example
Testing Patterns
Test Setup
Multiple Scenarios
Performance Tips
Best Practices
Consistent Seeds
Use the same seed value for tests to ensure reproducible results
Realistic Data
Use appropriate generators to create data that resembles production
Relationship Balance
Use weighted relationships to simulate realistic data distribution
Clean State
Reset database between test runs for isolation
Next Steps
Schema Validation
Validate seeded data with Zod, Valibot, or TypeBox
Testing Guide
Learn testing patterns with Drizzle ORM