prisma-examples icon indicating copy to clipboard operation
prisma-examples copied to clipboard

QwikJS Example?

Open y471n opened this issue 1 year ago • 1 comments

Hi, I was wondering if you guys can create a Qwik example as well for best practices such as you've for NextJS:


let prisma: PrismaClient

if (process.env.NODE_ENV === 'production') {
    prisma = new PrismaClient()
} else {
    if (!global || !global.prisma) {
        global.prisma = new PrismaClient()
    }
    prisma = global.prisma
}
export default prisma

Above throws errors and issues in a QwikJS Project.

y471n avatar Mar 02 '23 11:03 y471n

What about this?

  • src/entry.ssr.tsx

... export const prisma: PrismaClient = new PrismaClient(); ...

notcod avatar Dec 19 '23 13:12 notcod