what's the equivalent of SQL query for following? ...
# orm-help
y
what's the equivalent of SQL query for following? ( is there any function that transform prisma client query into SQL query? )
accntId : 1, regionId: 1
Copy code
this.prisma.cidrBlock.findFirst({
  where: {
    vpcs: {
      none: {
        account_id: accntId,
        region_id: regionId,
      },
    },
  },
  orderBy: {
    id: 'asc',
  },
});
✅ 1
a
Maybe you can log the queries. Search in the documentation about logging queries
👍 1
y
https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#none i would've not asked if i had not read doc first. if
account_id: true, region_id: true
then it makes sense because it's what the doc said but i don't know why they(example above) have "value" in there. maybe that query is just totally wrong. i'll keep digging until i know more.
oh, you mean for the tool to get raw sql query? https://www.prisma.io/docs/concepts/components/prisma-engines/query-engine#debugging-the-query-engine i was looking for query doc. that's a good idea. thanks for the tip, i'll try it
i'm sorry for getting offensive
n
Hey 👋 Here’s how you could configure logging to log the queries which are being invoked by Prisma.
Copy code
const prisma = new PrismaClient({
  log: ['query'],
})