diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2024-01-29 22:37:13 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2024-01-30 12:57:21 -0500 |
| commit | 9e300e0ff0c9d93cbaeaa86c1e2a560523107382 (patch) | |
| tree | ebeaea60117fbac781a415e3299395f3f8e637d7 /src/lib/prisma.ts | |
| parent | 3847a67a192a04098643e19953549a99ca152b8a (diff) | |
Use React’s cache to avoid some queries to the database
Diffstat (limited to 'src/lib/prisma.ts')
| -rw-r--r-- | src/lib/prisma.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index 2886a89..08ec624 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -9,7 +9,9 @@ export async function getPrisma() { prisma = new PrismaClient() } else { if (!(global as any).prisma) { - ;(global as any).prisma = new PrismaClient() + ;(global as any).prisma = new PrismaClient({ + // log: [{ emit: 'stdout', level: 'query' }], + }) } prisma = (global as any).prisma } |
