Skip to content

Commit

Permalink
Refactor PrismaClient initialization and schema configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
GithmiHashara committed Sep 14, 2024
1 parent b04d88b commit 99d1cf3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions app/libs/prismadb.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// import { PrismaClient } from '@prisma/client'

// // Ensure the prisma instance is only created once
// declare global {
// var prisma: PrismaClient | undefined
// }


// // Create a new PrismaClient instance if there isn't one already
// const client = globalThis.prisma || new PrismaClient()

// // Assign the prisma client to the global object if it doesn't exist
// if (process.env.NODE_ENV !== 'production') globalThis.prisma = client

// export default client;


import { PrismaClient } from '@prisma/client'

// Ensure the prisma instance is only created once
Expand Down
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

generator client {
provider = "prisma-client-js"
output = "./generated/client"
output = "./generated/client"
}

datasource db {
Expand Down

0 comments on commit 99d1cf3

Please sign in to comment.