
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
prisma-fertilizer
Advanced tools
Generate seed files for Prisma projects using Faker.js.
Prisma Fertilizer is a command-line tool that analyzes your Prisma schema and automatically generates a seed file with realistic fake data using Faker.js. This tool helps you quickly populate your database with test data that matches your schema's structure and relationships.
npm install -g prisma-fertilizer
npm install --save-dev prisma-fertilizer
# Basic usage with default options
npx prisma-fertilizer
# Specify schema path
npx prisma-fertilizer --schema ./path/to/schema.prisma
# Specify output path
npx prisma-fertilizer --output ./path/to/seed.js
# Generate 20 records per model
npx prisma-fertilizer --count 20
# Force overwrite of existing seed file
npx prisma-fertilizer --force
# Generate seed data for specific models only
npx prisma-fertilizer --models User,Post,Comment
-s, --schema <path>: Path to your Prisma schema file (default: ./prisma/schema.prisma)-o, --output <path>: Output path for the generated seed file (if not specified, defaults to the same directory as your schema file)-c, --count <number>: Number of records to generate for each model (default: 10)-f, --force: Overwrite existing seed file if it exists without prompting (default: false)-y, --yes: Skip all confirmation prompts and use defaults (default: false)-v, --version: Display version information-h, --help: Display help informationPrisma Fertilizer intelligently sets the default output path for your seed file to be in the same directory as your schema file. This means:
./prisma/schema.prisma, the default output will be ./prisma/seed.js./src/database/schema.prisma, the default output will be ./src/database/seed.jsThis behavior makes it easier to keep your seed files organized alongside your schema files, which is the recommended practice for Prisma projects.
When you run Prisma Fertilizer without using the -y flag, it will prompt you interactively:
$ prisma-fertilizer
🌱 Prisma Fertilizer - Generating seed file...
Where would you like to place the seed file? [./prisma/seed.js]: ./src/db/seed.js
# Model selection with checkboxes
Select models to generate seed data for (use space to select, enter to confirm):
❯◯ User
◯ Profile
◯ Post
◯ Comment
◯ Tag
The interactive mode provides a user-friendly checkbox interface for selecting which models to include in your seed file. Use the space bar to select/deselect models and press Enter to confirm your selection.
If the file already exists, it will ask for confirmation before overwriting:
File already exists at ./src/db/seed.js. Overwrite? (y/N):
Prisma Fertilizer automatically checks if your project has the required @faker-js/faker dependency installed. If it's not found, it will offer to install it for you:
⚠️ Warning: @faker-js/faker is not installed in your project.
The generated seed file will require this package to run.
Would you like to install @faker-js/faker as a dev dependency? (Y/n):
For a schema with User and Post models:
model User {
id Int @id @default(autoincrement())
email String @unique
name String
posts Post[]
createdAt DateTime @default(now())
}
model Post {
id Int @id @default(autoincrement())
title String
content String
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId Int
createdAt DateTime @default(now())
}
The generated seed file will create users with realistic names and emails, and posts with appropriate titles and content, maintaining the relationships between them.
See CONTRIBUTORS.md for a list of the project's contributors.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Generate seed files for Prisma projects using Faker.js
We found that prisma-fertilizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.