'Prisma Query doesn't log using all methods
I'm trying to debug what is wrong with a query as it doesn't return any results.
I'm trying the query logger using the following snippet, but no joy
const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient({
log: [
{
emit: "event",
level: "query",
},
],
});
prisma.$on("query", async (e) => {
console.log(`${e.query} ${e.params}`)
});
module.exports = prisma
I'm using express, but this should relate to this.
NODE_ENV=development
I have also tried this package: prisma-query-log but also it doesn't work. What am I missing
This is the query:
const query = {
skip: offset,
take: limit,
};
const filteredProperties = prisma.property.findMany(
query
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
