Skip to content

Commit 6ac2da9

Browse files
committed
refactor: rename db variable to prisma
1 parent 2a6bdaf commit 6ac2da9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/lib/prisma.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { logger } from '@/utils/logger'
22
import { PrismaClient } from '$/generated/prisma'
33

4-
const db = new PrismaClient({
4+
export const prisma = new PrismaClient({
55
log: [
66
{
77
emit: 'event',
@@ -24,11 +24,9 @@ const db = new PrismaClient({
2424
errorFormat: 'pretty',
2525
})
2626

27-
db.$on('query', (e) => {
27+
prisma.$on('query', (event) => {
2828
logger.log('')
29-
logger.log('Query: ' + e.query + ' in ' + e.duration + 'ms')
30-
logger.log('Params: ' + e.params)
29+
logger.log(`'Query: ${event.query} in ${event.duration}ms'`)
30+
logger.log(`Params: ${event.params}`)
3131
logger.log('')
3232
})
33-
34-
export default db

0 commit comments

Comments
 (0)