Add debug mode, for understand on which db request was sended
A debug mode, or a way to log the queries will really help. For example, I have a NestJs project with two different services, one for write and another for read only. In the service for write I can do this this.prisma.$on('query', console.log); to see the query and the parameters. But the $on method doesn't exists when I create the prisma client like this:
const prisma = new PrismaClient({
log: [
{
level: 'query',
emit: 'event',
},
],
}).$extends(readReplicas({ url: String(process.env.DATABASE_READ_URL) }));
Did I created the client right? And is there any way to log the queries?
Hope to merge the PR #30 for logging too
Aforementioned PR got merged and released, there is a logging example in README now: https://github.com/prisma/extension-read-replicas#pre-configured-clients