WaspW
Wasp12mo ago
dexie

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')
})


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
            },
          },
        },
      },
    })
Was this page helpful?