mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-29 19:30:33 +01:00
Change prisma log
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
|
import { PrismaClient } from '@prisma/client'
|
||||||
import type { inferAsyncReturnType } from '@trpc/server'
|
import type { inferAsyncReturnType } from '@trpc/server'
|
||||||
import type { H3Event } from 'h3'
|
import type { H3Event } from 'h3'
|
||||||
import { PrismaClient } from '@prisma/client'
|
|
||||||
|
|
||||||
let prisma: PrismaClient | undefined
|
let prisma: PrismaClient | undefined
|
||||||
|
|
||||||
export function createContext(_event: H3Event) {
|
export function createContext(_event: H3Event) {
|
||||||
if (!prisma) {
|
if (!prisma) {
|
||||||
prisma = new PrismaClient({
|
prisma = new PrismaClient({
|
||||||
log: process.env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'],
|
log: ['warn', 'info', 'error'],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user