Title
c

Celestine

02/25/2022, 7:06 PM
I am trying to call a stored procedure using prisma. It is returning data, but the object in the result list doesn’t have the appropriate column names as key. My code looks something like this:
const result = await this.prisma.$queryRaw<
      Prisma.categorySelect[]
    >`CALL catalog_get_categories_for_product(${productId})`;

    return result;
The returned result looks like this:
[
  {
    "f0": 1,
    "f1": 1,
    "f2": "French"
  }
]
What I am expecting:
[
  {
    "category_id": 1,
    "department_id": 1,
    "name": "French"
  }
]
Does anyone have an idea why the column names are not being returned correctly?
đź‘€ 1
@janpio do you have any thoughts on this?
j

janpio

03/09/2022, 5:04 PM
Not really, besides that you can create an issue with a reproduction (including the code to create this stores procedure) and we would take a look.