generate_seed
Creates ORM-aware seed files with realistic faker data for development and testing. Specify resource and count to automate database population.
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 |
|---|---|---|---|
| dir | No | Absolute or relative path to the BackGen-generated project directory. Defaults to the current working directory. Example: '/home/user/projects/my-api'. | |
| 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. | |
| 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'. |