generate_seed
Generates a seed file for a resource, inserting faker-generated realistic records into the database for Prisma, Drizzle, or Mongoose.
Instructions
Creates a database seed file for a resource — a script that inserts realistic development data into your database so you don't manually populate tables while building features. The seed file is ORM-aware: it outputs to prisma/seeds/.ts for Prisma, db/seeds/.ts for Drizzle, or seeds/.ts for Mongoose. Each seed record uses faker-generated realistic values matching the resource's field types. Run generate_resource first for the resource you want to seed. After generating, you run the seed via 'npm run seed' in the project directory to insert the data. Use count to control how many records to generate — 10 is fine for development, 50-100 for load testing or demo environments. Maximum 1000.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resource | Yes | Resource name in PascalCase — must start with an uppercase letter. Must match an existing resource generated by generate_resource. Examples: 'Product', 'User', 'Appointment'. | |
| count | No | Number of seed records to generate. Use 5-10 for quick development setups where you just need sample data. Use 50-100 for demo environments, load testing, or populating dropdowns with realistic options. Max 1000. | |
| dir | No | Absolute or relative path to the BackGen-generated project directory. Defaults to the current working directory. Example: '/home/user/projects/my-api'. |