How to convert prisma $queryRaw to drizzle
const adjustmentResults = (await prisma.$queryRaw`
SELECT
DATE_TRUNC('month', ae.date, ${NA_TIMEZONE}) AS date,
ae.marketplace,
ae.type,
SUM(ae.quantity * uc."cost") AS "adjustment"
FROM "MasterProduct" AS mp
JOIN "MasterProductUnitCost" AS uc ON (mp.id = uc."masterProductId")
JOIN "InventoryItem" ii ON (uc."masterProductId" = ii."masterProductId")
JOIN "AdjustmentEvent" AS ae ON (ii."groupId" = ae."groupId" AND ii.marketplace = ae.marketplace AND ii.sku = ae.sku)
WHERE
mp."userId" = ${userId}
AND ii."userId" = ${userId}
AND ae."userId" = ${userId}
AND ae.date >= uc."fromDate"
AND (uc."toDate" IS NULL OR ae.date < uc."toDate")
GROUP BY 1, 2, 3
`) as MonthlyAdjustmentsData[];const adjustmentResults = (await prisma.$queryRaw`
SELECT
DATE_TRUNC('month', ae.date, ${NA_TIMEZONE}) AS date,
ae.marketplace,
ae.type,
SUM(ae.quantity * uc."cost") AS "adjustment"
FROM "MasterProduct" AS mp
JOIN "MasterProductUnitCost" AS uc ON (mp.id = uc."masterProductId")
JOIN "InventoryItem" ii ON (uc."masterProductId" = ii."masterProductId")
JOIN "AdjustmentEvent" AS ae ON (ii."groupId" = ae."groupId" AND ii.marketplace = ae.marketplace AND ii.sku = ae.sku)
WHERE
mp."userId" = ${userId}
AND ii."userId" = ${userId}
AND ae."userId" = ${userId}
AND ae.date >= uc."fromDate"
AND (uc."toDate" IS NULL OR ae.date < uc."toDate")
GROUP BY 1, 2, 3
`) as MonthlyAdjustmentsData[];I have a query like this. I want to just drop in the SQL the same way but can't seem to get it to work with
await db.execute(sql<MonthlyAdjustmentsData[]>`<sqlgoeshere>`);await db.execute(sql<MonthlyAdjustmentsData[]>`<sqlgoeshere>`);TypeError: query.getSQL is not a functionhow am i supposed to do this?
