Prisma Seed File Temaplate

Does anyone have a template for a seed file and data file to the t3stack template?
2 Replies
Neto
Neto14mo ago
Prisma
Seeding your database
Learn how to seed your database using Prisma's integrated seeding functionality and Prisma Client
whatplan
whatplan14mo ago
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
async function main() {
await prisma...
}
main()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
async function main() {
await prisma...
}
main()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});