What happened?
Variable is discarded when I expect it to be used. Ideally, the variable would just be used as defined. In the worst case, this should at least be a type error.
PRQL input
prql target:sql.postgres
let mod_id = (from users | filter login == "nightpool" | select id | take 1)
from events
filter actor_id == mod_id
sort (-event_occurred_at)
take 10
SQL output
SELECT
*
FROM
events
WHERE
actor_id = mod_id
ORDER BY
event_occurred_at DESC
LIMIT
10
Expected SQL output
SELECT
*
FROM
events
WHERE
actor_id = (select id from users where login = 'nightpool' limit 1)
ORDER BY
event_occurred_at DESC
LIMIT
10
MVCE confirmation
Anything else?
I can't get PRQL to generate a subquery at all in any format. Maybe there's something i'm missing? "into mod_id" also has the same issue.
What happened?
Variable is discarded when I expect it to be used. Ideally, the variable would just be used as defined. In the worst case, this should at least be a type error.
PRQL input
SQL output
Expected SQL output
MVCE confirmation
Anything else?
I can't get PRQL to generate a subquery at all in any format. Maybe there's something i'm missing? "into mod_id" also has the same issue.