-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/import-eventbrite-provider
- Loading branch information
Showing
2 changed files
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ DATABASE_URL=postgres://postgres:[email protected]:5432/db | |
``` | ||
|
||
### Configuration | ||
|
||
To improve performance using `Prisma ORM`, we can set up the Prisma instance to ensure only one instance is created throughout the project and then import it from any file as needed. This approach avoids recreating instances of PrismaClient every time it is used. Finally, we can import the Prisma instance from the `auth.ts` file configuration. | ||
|
||
```ts filename="prisma.ts" | ||
|
@@ -35,7 +36,7 @@ const globalForPrisma = globalThis as unknown as { prisma: PrismaClient } | |
|
||
export const prisma = globalForPrisma.prisma || new PrismaClient() | ||
|
||
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma | ||
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma | ||
``` | ||
|
||
<Callout type="warning"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters