How to seed a database with Prisma and Next.js
Feb 11, 2022James Q Quick

Summary
This post details how to seed a PlanetScale database using Prisma in a Next.js project. It covers the concepts of database seeding for initial setup, automated testing, and PlanetScale's branching feature. The tutorial walks through setting up a Next.js starter repository, configuring the database connection string, and creating a seed script using Prisma's `createMany` and `deleteMany` functions, as well as raw SQL for resetting auto-increment values. It also explains how to configure the seed command in `package.json` either via a custom script or the `prisma.seed` field.