P
Prisma3mo ago
DevPanda

Prisma Accelerate Typescript

Hey, what are the typings for Prisma Accelerate? why is prismaClientSingleton = any? this make no sense
import { PrismaClient } from "@prisma/client/edge";
import { withAccelerate } from "@prisma/extension-accelerate";

function prismaClientSingleton() {
return new PrismaClient().$extends(withAccelerate());
}

declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>;
} & typeof global;

const prisma = globalThis.prismaGlobal ?? prismaClientSingleton();

export default prisma;

if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma;
import { PrismaClient } from "@prisma/client/edge";
import { withAccelerate } from "@prisma/extension-accelerate";

function prismaClientSingleton() {
return new PrismaClient().$extends(withAccelerate());
}

declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>;
} & typeof global;

const prisma = globalThis.prismaGlobal ?? prismaClientSingleton();

export default prisma;

if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma;
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server