prisma / prisma-examples

🚀 Ready-to-run Prisma example projects

Home Page:https://www.prisma.io/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QwikJS Example?

y471n opened this issue · comments

commented

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.

What about this?

  • src/entry.ssr.tsx

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