I have been running into this issue when trying to...
# orm-help
p
I have been running into this issue when trying to use `queryRaw`:
Copy code
Your raw query had an incorrect number of parameters. Expected: `0`, actual: `2`
But my query does not use any parameters, I think.
Copy code
const history = await db.$queryRaw<HistoryData>`
  SELECT
    a.day,
    s."value" as slp,
    s."value"  - lag(s."value" ) over (order by a.day) as increase
  FROM (
    SELECT
      DISTINCT d.day,
      max(s. "date") OVER (ORDER BY d.day) AS effective_date
    FROM (SELECT generate_series('2021-10-01'::date, now()::date, '1d')::date) d (day)
    LEFT JOIN "WalletsHistory" s ON DATE(s.date) = d.day AND s.wallet_id = '${wallet.id}'
  ) a
  INNER JOIN "WalletsHistory" s ON s.date = a.effective_date
    AND s.wallet_id = '${wallet.id}'
  ORDER BY
    a.day;
  `;
s
I think you gotta un-quote your params
👍 2
wallet_id = ${wallet.id}
I think
p
thanks!