Christophe Rudyj
08/09/2022, 5:42 PMMichael Jay
08/09/2022, 6:02 PMChristophe Rudyj
08/09/2022, 6:59 PMMichael Jay
08/09/2022, 7:16 PMSchalk Neethling
08/09/2022, 7:25 PMclient.ts
with the following:
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
export default prisma;
I then import it in the individual files I need it like so:
import prisma from "./client.js";
And then use it as follows:
const deletedEntry = await prisma.targetWord.delete({ where: { id } });
Schalk Neethling
08/09/2022, 7:28 PM