Skip to content

The only tool you need to know what is happening and how to fix it.

497 B
Raw Blame
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

async function main() {
  await prisma.user.createMany({
    data: [
      { name: "Alice", email: "[email protected]" },
      { name: "Bob", email: "[email protected]" },
      { name: "Charlie", email: "[email protected]" },
    ],
  });
  console.log("Seeded 3 users");
}

main()
  .then(() => prisma.$disconnect())
  .catch((e) => {
    console.error(e);
    prisma.$disconnect();
    process.exit(1);
  });