skip to Main Content

This is the query that I am executing

const jobs = await this.prisma.$executeRaw`
SELECT
  name
 FROM 
  jobs 
 WHERE 
  status = 'ACTIVE'`;

but instead of getting the results that macth this query I only get a number, so the type of jobs is number and its value is 1. I am using postgresql

2

Answers


  1. Chosen as BEST ANSWER

    Problem was that I was using wrong method so instead of .$executeRaw I should have used $.queryRaw


  2. Try modifying your code to use the $queryRaw method instead;

    const jobs = await this.prisma.$queryRaw`
    SELECT
      name
     FROM 
      jobs 
     WHERE 
      status = 'ACTIVE'`;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search