dexie
dexie
WWasp
Created by dexie on 12/29/2024 in #đŸ™‹questions
Prisma logging (and other PrismaClient modifications)
Hello! When using prisma I am used to debugging queries by logging them using the following:
prisma.$on('query', (e) => {
console.log('Query: ' + e.query)
console.log('Params: ' + e.params)
console.log('Duration: ' + e.duration + 'ms')
})
prisma.$on('query', (e) => {
console.log('Query: ' + e.query)
console.log('Params: ' + e.params)
console.log('Duration: ' + e.duration + 'ms')
})
Is it possible to achieve something like this when using Wasp? Additionally, there is "client extensions" feature in Prisma, which would be amazing to use in Wasp: i.e.
const extendedPrisma = prisma
.$extends({
result: {
user: {
fullName: {
needs: { name: true, surename: true },
compute(data) {
return data.name + " " + data.surname
},
},
},
},
})
const extendedPrisma = prisma
.$extends({
result: {
user: {
fullName: {
needs: { name: true, surename: true },
compute(data) {
return data.name + " " + data.surname
},
},
},
},
})
25 replies