Neat. I did a similar thing for analysing the output of commands that can produce JSON (SLURM in this case). Worked pretty well but I immediately ran into PRQL's lack of support for DuckDB's struct types.
As a result, I'll be adding support for PIVOTs very soon, either in the main repo or just in a temporary fork.